Re: [Jack-Devel] Avoiding spinlocks in a parallel sequencer

PrevNext  Index
DateSat, 11 Apr 2015 14:46:47 -0400
From Paul Davis <[hidden] at linuxaudiosystems dot com>
ToJohannes Lorenz <[hidden] at mailueberfall dot de>
CcJACK <[hidden] at lists dot jackaudio dot org>
In-Reply-ToJohannes Lorenz Re: [Jack-Devel] Avoiding spinlocks in a parallel sequencer
On Sat, Apr 11, 2015 at 1:25 PM, Johannes Lorenz <
[hidden]> wrote:

> > > Nonetheless, if I have 40 instances of zyn, I'd
> > > like to (actually must) compute them concurrently. So how to do this
> with
> > > one client?
> >
> > By using your own internal graph mechanism that has parallel
> capabilities.
> > See, for excample, https://github.com/flowprogramming/dspatch
>
> This one is based on pthread_cond_wait(), which is either implemented as a
> spinlock or not realtime safe (I guess the second). So how can this help?
>

it was just an example. ultimately, *some* synchronization primitive is
required. the question is what is the least bad choice ....


>
> > > The best way I can see is using an array of jack clients, and hoping
> > > they'll process() at the same time. However, this sounds very tricky...
> >
> > There can be very good reasons for using JACK 1. If a user is doing that,
> > you won't get any parallelization at all.
>
> Does JACK 2 allow to use multiple jack clients that call process() at the
> same time? Or does it allow to enter process() with multiple threads? There
> seems to be no documentation/tutorial about JACK 2.
>

clients do not "call process". process() is called on their behalf, by the
server, in a thread chosen by the server.

the relationship between threads and callbacks is an undocumented,
implementation specific part of JACK, and differs between JACK1 and JACK2.
PrevNext  Index

1428778014.31178_0.ltw:2, <CAFa_cKkaBLROBEisK8FK=j7K2ZErF8ryPRF4iwGqokphdbRzgg at mail dot gmail dot com>