5.9 - Is LJM thread-safe? | LabJack
 
« Close

Datasheets and User Guides

App Notes

Software & Driver

 
Wednesday April 1st, 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 55/56 products in stock. More details.
Supply Chain: Some disruptions. More details.

5.9 - Is LJM thread-safe?

LJM is thread-safe. It synchronizes devices between threads so that multiple threads can use the same device handle.

Applications using the same device handle in multiple threads still must coordinate the closing of device handles—if one application thread calls LJM_Close for a given device handle, that device handle will be closed for all threads.

For applications that need to stream data, LJM_SetStreamCallback is an easy way start a worker thread.

Other Remarks

For using LJM and the Python libraries multiprocessing and Tkinter on macOS: It matters when you import Tkinter—you must import it after the multiprocessing process(es) have started. For more details, see the forum topic Multiprocessing with Tkinter and LabJackPython.