[PD-dev] Is gensym() threadsafe?

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


On Wed, 14 Dec 2005, Thomas Grill wrote:

>
>
> Kjetil S. Matheussen schrieb:
>
>> 
>> How about changing sys_lock to something like this:
>> 
>> void sys_lock(){
>>    if(pd_is_running_realtime() && caller_is_not_running_realtime()){
>>       post("Error! You must run your thread with realtime priority to be 
>> allowed to call sys_lock. Period!");
>>       abort();
>>    }
>>    ...
>> }
>> 
> 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.

I definitely think something like that should go in. If you are not 
running realtime and aquire the lock you potentionally can screw up the 
sound in a way that can only be solved by letting yourself be running 
realtime.



-- 




More information about the Pd-dev mailing list