@stefan, thanks for the hackery method =)
@kas, i thought i tried that, but i might have gotten confused at the "spork ~ my_fun() @=> my_shred;" line
the online documentation says "spork ~ my_fun() => Shred @ my_shred;" without declaring my_shred first, and this gives syntax errors.
I was trying to do the my_shred.exit(); thing, but was getting syntax errors. i didn't save what i was working on, so i can't post it, but i'll try it this way when i get a chance.
thanks
-k
On 17/03/2008, Stefan Blixt <stefan.blixt@gmail.com> wrote:Doesn't this effectively happen if the method executing in the shred exits? LIke this:-----------------------------------------
Yes, it does, and that's one way. Another is to use the "Machine" device. For example "Machine.remove(15);" will remove the shred with id 15 (see chuck --status for id numbers). Note that that spork operations will return the id of the new shred as a int.
Also possible;
--------------------------------------------------
//create a shred reference with a name
Shred my_shred;
//assign a bit of running code to it
spork ~ my_fun() @=> my_shred;
//other stuff happens
5::minute => now;
//this is really quite readable compared to other options.
my_shred.exit();
Hope that helps,
Kas.
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users