LJM_STREAM_THREADS_PRIORITY_MODE | LabJack
 
« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_STREAM_THREADS_PRIORITY_MODE

Requires LJM 1.2100 or later.

Summary

Determines how LJM sets processor priority for LJM's internal stream threads.

LJM_STREAM_THREADS_PRIORITY_AUTO_ELEVATED = 1 (default)

  • LJM sets elevated priority on internal stream threads as they are created.
  • Device data collection thread:
    • Windows: THREAD_PRIORITY_TIME_CRITICAL
    • Linux/macOS: Real-time SCHED_FIFO, priority 90
  • Other LJM stream threads, including any callback threads (see LJM_SetStreamCallback):
    • Windows: THREAD_PRIORITY_HIGHEST
    • Linux/macOS: Real-time SCHED_RR, priority 50

LJM_STREAM_THREADS_PRIORITY_UNALTERED = 2

  • LJM's internal stream threads inherit priority.

The constant LJM_STREAM_THREADS_PRIORITY_MODE can be used interchangeably with the string "LJM_STREAM_THREADS_PRIORITY_MODE".

Remarks

LJM_STREAM_THREADS_PRIORITY_MODE does not affect currently running or already initialized streams.

If thread priority cannot be set, a debug log message is generated.

See also the related LJM_STREAM_PROCESS_PRIORITY_MODE, which sets priority for the process instead of for threads.

Relevant Functions

To read LJM_STREAM_THREADS_PRIORITY_MODE, use LJM_ReadLibraryConfigS.

To write LJM_STREAM_THREADS_PRIORITY_MODE, use LJM_WriteLibraryConfigS or LJM_LoadConfigurationFile.