[chuck-users] machine add oddity

Kassen signal.automatique at gmail.com
Wed Feb 15 05:33:36 EST 2012

On Tue, Feb 14, 2012 at 11:27:56PM -0500, mike clemow wrote:

> Is that the entire file or just a snippet?  I've sometimes run into a
> problem where my last line is some tiny amount of time (e.g. 1::samp
> => now) and the previous line is a spork ~ someFun(); or a
> Machine.add() and the main code exits before the shred-spawning
> function ever has a chance to return.

Quite so, and this is interesting. The same can (could?) happen for
printing statements. With print I can understand it because (if I
remember correctly) printing doesn't return anything. Machine.add()
should be waited for (strictly speaking) because it will return a
value, being a integer indicating the Shred's id.

Waiting for such calls that depend on the OS (both involve the shell
displaying some text) is risky though, because most OS's aren't
realtime and where they are we could still advance time by less than
the period in which the OS guarantees getting round to such tasks in.

At any rate it's a interesting case. 


More information about the chuck-users mailing list