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

Ge Wang ge at ccrma.Stanford.EDU
Mon Nov 19 03:51:09 EST 2007


> -----------------------------
> 2 => int n;
> Shred foo[n];
> while(1)
>    {
>    <<<foo[Std.rand2(0,foo.cap()- 1)].id()>>>;
>    second => now;
>    }
> -------------------------------
> Run that a few times for various values for n. Something very weird is 
> going on here, -1266432768 seems like a very odd number as a shred id, 
> especially when the VM monitor (running these in the mini) reports only 
> a single shred.

This is bug, where the internal ID is uninitialized for user instantiated 
Shred instances.  This has been fixed in CVS (unsporked shreds id default 
to 0).  However, it brings up the bigger question of what this user 
created Shred might be used for, since currently, there is no facility to 
spork from these Shred objects (at the moment, Shred instances are 
internally created and can be accessed afterwards).  For now, perhaps it 
makes sense to disable Shred instantiation from code?  Thoughts?


More information about the chuck-users mailing list