[Jack-Devel] Helper threads with lower priority?

Johannes Lorenz j.spam at lorenz-ho.me
Sat Jun 29 14:53:45 CEST 2019


Hello,


we run a DAW (LMMS) with jack and would like to exploit multiple cores. 
Currently, we have one jack process (using `jack_set_process_callback`) 
and multiple other processes that share all the work. The problem is 
that only the jack process has RT prio. Imagine the following example:

* 4 threads, of which one is the jack thread, 3 have lower priority
* 4 tasks (e.g. 4 instruments play one note each)
* the realtime process is finished quickly, the other threads get 
preempted by the kernel

These are situations where using such non-realtime helper threads can 
threaten realtime behaviour. What is the best practice?

* Is it possible/good to use multiple rtprio threads controlled by jack? 
(multiple clients, or multiple threads in one client)
* Should we keep using our non-rt helper threads?
* Should we be single-threaded, to have a (probably) longer average 
time, but a better worst-case time?
* Should we start with helper threads and only the last few jobs will 
only be run by the realtime thread (to avoid problems like in the 
example)?


Many thanks on advance!

Johannes



More information about the Jackaudio mailing list