[chuck-users] unsporking

kevin vacillates at gmail.com
Mon Mar 17 14:24:14 EDT 2008


@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 Mon, Mar 17, 2008 at 4:02 AM, Kassen <signal.automatique at gmail.com>
wrote:

>
>
> On 17/03/2008, Stefan Blixt <stefan.blixt at 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 at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080317/324eda4f/attachment.htm 


More information about the chuck-users mailing list