[PD-dev] outlet_anything() & threads

Hans-Christoph Steiner hans at eds.org
Wed May 17 12:46:13 CEST 2006


On May 17, 2006, at 11:00 AM, Tim Blechmann wrote:

> On Wed, 2006-05-17 at 10:38 +0200, Hans-Christoph Steiner wrote:
>> latency, there would be no difference in latency if a Pd object was
>> polling a thread or polling a file in /dev/; that object would still
>> be polling at the same rate.  Adding a thread would just put extra
>> code between the Pd object and the /dev/ file.
>
> yes ... but using pd's timer callbacks to poll the devices introduces
> two problems:
> - pd's timer callbacks are implemented as a linked lists ... adding  
> to a
> linked list is highly inefficient ... O(n) ... one of the biggest
> problems of pd's scheduler ...

Perhaps in theory, but Pd's scheduler is working quite well for me  
and a few thousand other people.  But I don't pay attention to the  
implementation details.

> - polling the device from the pd thread would add overhead code  
> which is
> possibly blocking ... so your code can't be used in low-latency
> systems ...

[hid] currently uses no threads, yet I have not heard any complaints  
about blocking/clicks.  Also, I have yet to hear any clicks caused by  
[hid].

Please send an example patch if you can make [hid] cause clicks.

.hc
________________________________________________________________________ 
____

"Computer science is no more related to the computer than astronomy  
is related to the telescope."
                                                           -Edsger  
Dykstra





More information about the Pd-dev mailing list