[PD] finding which instance executes first

IOhannes m zmoelnig zmoelnig at iem.at
Tue May 16 12:17:42 CEST 2006


Frank Barknecht wrote:
> Hallo,
> Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
> 
>> I am about to start working on the [hid] v2 stuff, and I just had a 
>> thought.  Is there any way to find out which instance of an object 
>> executes first?
>>
>> My idea is to have the first instance of the [hid] object do the reading 
>> of event data from the OS and write it to memory.  Then every other 
>> instance will just output the data from memory.  But in order for this to 
>> work properly, the first instance to execute needs to do the 
>> data-getting.
> 
> There was a thread about singletons a while ago, which resulted in the
> singleton.pd that is used in [sssad]. 
> 

but isn't this something different? i think, hans's problem is with 
execution-order at run-time and not with creation order at load-time.

hans:
what is wrong with threads here? i do think that threads is the way to 
go when interfacing objects that might block the main thread (and i am 
pretty sure that using libusb is prone to blocking)
a thread-less solution would be to get the difference of _logical_ time 
since the last "bang" of the object and do the data-retrieval only if 
this time is >0 (or better: !=0)

mfg.asdr
IOhannes




More information about the Pd-list mailing list