Hallo!
threadlib is a library for threaded patching and threaded PD externals heavily based on pd_devel code by Tim Blechmann (his detach/join for pd_devel)
you can get it there (also binaries): http://grh.mur.at/software/threadlib.html or in cvs ...
LG Georg
PS: README file:
PD objects for threaded patching:
WARNING: these objects (especially detach/join) are very experimental and may crash your patches if you use them in the wrong way, because some externals/internals are not threadsafe!
Features for PD external programmers:
Many thanks to Tim Blechmann for his code and help!
detach: Detach is working on control objects only, creates a helper thread and runs all functions of the following objects in this helper thread. If a message from that thread reaches a join object a callback for running the outlet function will be placed in the scheduler and run in the next scheduler loop - so you can synchronize the message with pd's main thread again. Detach is useful if you have a control operation that would be too CPU-intensive and would disturb dsp.
join: The message to the inlet will be sent to the outlet during the next clock callback of the scheduler. It doesn't matter, which thread the message was coming from. Messages from the main pd thread will be rescheduled. Join can be used everywhere, where a message has to be rescheduled, this is also useful to place behind any threaded external calling the outlet functions from the helper thread, to make sure the following messages are being run in the main pd thread.
!!! WARNING: !!! detach/join provide the possibility of threaded patching. beware of the risks:
code or ask at the pd-list or me)
detached. don't mix threaded and non-threaded message paths unless you know what you are doing. use the join external to synchronize with the main pd thread!!!!
really need threaded patching, e.g. have a subpatch that has to run for quite some time and would interrupt audio or something else