[alsa-devel] parallel, real time safe waiting?
Hello,
I'd like to write a sequencer that can handle many synthesizers. Thus, I want them to run these synths parallel. Still, I'd like to keep my code real time safe, i.e. no malloc(), usleep(), ofstream, pthread mutexes etc. However, I wondered how to let all my threads sleep for x useconds if there's nothing to do for x useconds.
My idea was:
1.) Let each thread open a handle using snd_seq_open() 2.) Call snd_pcm_wait() in each thread
Are these functions
a) real time safe? b) race-condition free, assuming I'll use pairwise different handles each thread
Many thanks for any help.
Kind regards, Johannes
Johannes Lorenz wrote:
1.) Let each thread open a handle using snd_seq_open() 2.) Call snd_pcm_wait() in each thread
Are these functions
a) real time safe?
snd_seq_open() is not, but why would that matter? Don't you call it from the GUI thread?
b) race-condition free, assuming I'll use pairwise different handles each thread
Yes.
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
Johannes Lorenz