[PD-dev] Is gensym() threadsafe?

Kjetil S. Matheussen kjetil at ccrma.stanford.edu
Wed Dec 14 00:29:16 CET 2005


On Wed, 14 Dec 2005, Tim Blechmann wrote:

>>> What would be gained by that?
>>>
>>
>> To ensure that the caller won't block PD, unless the caller explicitly
>> calls fread, usleep or other non-realtime functions while holding the
>> lock.
>
> well, it's not as easy as that ... pd is not designed to be a
> multithreaded application ...
> so someone could just say ... "don't use threads"
>

I don't understand why its not as easy as that... Theres nothing wrong
using threads and locks as long as all of them is running realtime.

You already know the following, but just to clarify: You have a problem if 
a realtime thread is waiting on a non-realtime thread, then, any 
non-realtime thread in the system can interrupt the realtime thread. My 
proposial for sys_lock eliminates that particular problem.



-- 




More information about the Pd-dev mailing list