[chuck-users] soft kill

Bastian Schumacher bastian.schumacher at yahoo.de
Sat Aug 18 13:47:59 EDT 2012


Hi Michael,

killing a thread means means immediate de-scheduling. There is not such a thing as "soft kill" in any software because the scheduler is not the place where that kind of functionality belongs to. What you want is a "quit"-mechanism for your program:

Threads that run "forever" contain a while(true) loop. A thread without that loop will stop running after finishing its commands. You need to use some kind external trigger be able to set that while loop condition to false (your "soft kill" button). Then you can place the "running out" code below the main loop, e.g. another while(signalStillActive)-loop with some kind of signal detector for your delay.

regards,
Basti

Am 15.08.2012 um 00:18 schrieb Michael Heuer:

> Hello,
> 
> I was having some fun with delays in ChucK when I should have been
> paying attention in a meeting and ran into something I may have asked
> about before -- is there (or should there be) any way any way to soft
> kill a shred, either by ramping down its gain or by waiting until the
> shred is no longer sending output to dac?  If I
> 
> $ chuck - 1
> 
> something that is running it kills it immediately, and if I don't
> advance time long enough explicitly at the end of a delay example, the
> nice feedback tail gets abruptly cut off.  E.g.
> 
> https://github.com/heuermh/lick/blob/master/examples/mfm2.ck  (doesn't
> require LiCK to run)
> 
>   michael
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list