[chuck-users] osc listener shred woes

Kassen signal.automatique at gmail.com
Mon Apr 28 19:03:53 EDT 2008

2008/4/28 Atte André Jensen
> Ok, so to put in a language that I understand, are you saying I should
> replace my 1::samp => now with me.yield()?
Yes, I think so.

Advancing time, which is what you are doing, gives other shreds a chance to
run but it also means this shred will only get the cpu back in a while.

The difference is likely academic but if OSC messages would be flooding in
faster then you are advancing time the cue would pile up and latency (or
worse) would follow.

The core concept here is that "samp => now" does two things;
a) hand the cpu to other shreds
b) make the next bit of code execute in a while (likely a 44K'th of a second

me.yield() only does the first of the two and not the second.

The issue is that while it may look like ChucK is aimed towards
parallel-processing it's in fact very much focussed on making multiple
processes take turns sequentially. What we are dealing with here is (amongst
other issues) this exact sequence.

Hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080429/1bcc446e/attachment.htm>

More information about the chuck-users mailing list