[PD] problem making an audio-thread-safe external
Mathieu Bouchard
matju at artengine.ca
Sun Oct 18 17:20:05 CEST 2009
On Sun, 18 Oct 2009, Claude Heiland-Allen wrote:
> Ivica Ico Bukvic wrote:
>> iret1 = pthread_create( &thread, NULL, cwiid_pthread2_setRumble,
>> (void*) &rPars);
> This creates a new thread.
>> pthread_join(thread, NULL);
> This waits (blocking Pd's main thread) until the new thread terminates.
> So, why create a new thread only to immediately wait for it to terminate -
> that makes the program essentially behave in a single threaded way.
But if ever there's any way that this gets to run in a multithreaded way,
then the post() in cwiid_pthread2_setRumble will violate the
singlethreadedness of <m_pd.h> because sys_lock() is not being used.
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
More information about the Pd-list
mailing list