Tommaso Cucinotta | 7 Jun 2012 23:57
Picon
Favicon

Jack Fifo vs pthread_condvar ?

Hi all,

after some time, I'm re-looking at the audio cycle in Jack, and I'm not 
sure I've got right this: does the suspension of the Jack client threads 
on Linux rely ultimately on FIFOs ? (i.e., read() and write() syscalls). 
Would it be possible to use a pthread-synchronized mutex and condvar in 
shared memory, instead ? (quite sure you can place a pthread_mutex in 
shmem on Linux, but don't know about pthread_cond_wait()).

Thanks, bye.

     T.
Paul Davis | 8 Jun 2012 01:09

Re: Jack Fifo vs pthread_condvar ?



On Thu, Jun 7, 2012 at 5:57 PM, Tommaso Cucinotta <tommaso.cucinotta <at> sssup.it> wrote:
Hi all,

after some time, I'm re-looking at the audio cycle in Jack, and I'm not sure I've got right this: does the suspension of the Jack client threads on Linux rely ultimately on FIFOs ? (i.e., read() and write() syscalls). Would it be possible to use a pthread-synchronized mutex and condvar in shared memory, instead ? (quite sure you can place a pthread_mutex in shmem on Linux, but don't know about pthread_cond_wait()).

if there's a reason to switch, the thing to switch to is a semaphore, or even a raw futex. there's no justification for switching to pthread synchronization objects. there is some evidence that at this point in time, semaphores are faster. the synchronization via FIFOs does not happen via read/write syscalls, but via poll(2) and write(2). the reads just empty the FIFO and are not related to sync.

_______________________________________________
Jack-Devel mailing list
Jack-Devel <at> lists.jackaudio.org
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Gmane