[chuck-users] shreds, namespace, functions, classes, etc

Ge Wang ge at ccrma.Stanford.EDU
Mon Nov 19 04:01:10 EST 2007

Hi again Kassen and all!

> ------------------
> Shred foo[3];
> foo[0].exit();
> ------------------------
> This is quite mysterious to me, here a "Shred" (object) that's not a 
> "shred" (sub-process) can "exit". Those two lines don't generate any 
> errors, apparently they are fine but I have no idea what they do.

Yup, this part of the current state of things is confusing.  The Shred 
object is meant to represent a concurrent process/shred, so we'd have 
means to talk about and communicate with various shreds.  Instantiating a 
Shred in code (e.g., Shred foo;) simply makes one of these placeholder 
objects but no actual new shred is sporked in the VM.  And currently, 
there really isn't anything one can do with code-spawned Shred objects. 
In short, instantiating Shred's don't really create new actual VM shreds - 
the Shred type is there to deal with Shred internally created when spork ~ 
(and other sporking mechanisms) are invoked.

I hope this helps?


More information about the chuck-users mailing list