[PD-dev] object with worker thread
Georg Holzmann
grhPD at gmx.at
Thu Feb 2 19:50:16 CET 2006
Hallo!
>> the objects in threadlib, or sndfiler
>
> I am thinking of having one "worker" thread which listens for events
> then calls the output function for each instance of [hid]. So there
> would only be one worker thread per device, no matter how many
> instances of [hid] were accessing that device.
yes, [sndfiler] has also only one worker thread ... (see
externals/tb/sndfiler/src/sndfiler.c)
You can register a function in a FIFO (fifo_put), and this function will
be called from the worker thread, then you can use sys_callback to
synchronize with pd's main thread.
LG
Georg
More information about the Pd-dev
mailing list