[plt-scheme] solving the halting problem

From: Jos Koot (jos.koot at telefonica.net)
Date: Thu Jan 3 11:21:48 EST 2008

I glanced through the article and appreciate your care about safely killing 
threads. In relation to this topic, I have a trivial question. Usually I run 
MzScheme programs  from DrScheme's nice programming environment. As you 
surely will forgive me, not all my programs are correct. They may produce 
wrong results, or worse, they may unintentionally loop forever. If a program 
takes more time than I expect or allow,  I use the break button, which 
happens to react fast nowadays. It is clear to me that the break button does 
not kill threads that may have been spawn by my program. In that case I must 
double click the break button for a complete kill of all processes. But 
sometimes I forget to double click or the break rfesponds so quickly that 
the second click is not honoured. Then there is no other way to stop all 
threads than by quitting DrScheme altogether, or is there? Would it be 
possible and desirable to add a kill button or to convert the break button 
into a kill button after a break? I now that after a complete kill, the 
interactions window no longer works. That is allright of course. Dead is 
dead.
Jos Koot

----- Original Message ----- 
From: "Robby Findler" <robby at cs.uchicago.edu>
To: <dave at pawfal.org>
Cc: <plt-scheme at list.cs.brown.edu>
Sent: Wednesday, January 02, 2008 6:58 PM
Subject: Re: [plt-scheme] solving the halting problem


> Depends what you want to do. Others would say that breaking a thread
> is a good idea most of the time, but I'd say that killing is the
> easier route in general, and I'd try that first. To give you an idea
> of how to use killing and how we think about it, check out this paper:
>
>  http://www.cs.utah.edu/plt/kill-safe/
>
> Feel free to post if you have questions about it.
>
> Robby
>
> On Jan 2, 2008 11:34 AM, Dave Griffiths <dave at pawfal.org> wrote:
>> Ok, thanks - it looks like it's better solved in the Scheme world then.
>>
>> Am I right in thinking it's cleaner to shut down a custodian than 
>> breaking
>> a thread?
>>
>>
>> > The break button calls break-thread on the user's main thread (if the
>> > usre has created more threads, they won't be broken). The kill button
>> > shuts down the user's custodian, so you can simulate both of these
>> > programmatically. (I'm not sure about the embedding answer, but I do
>> > believe that when you're at the C level that the concurrency is
>> > cooperative, so you only get breaks at points where you explicitly
>> > yield control.)
>> >
>> > Robby
>> >
>> > On Jan 2, 2008 9:04 AM, Dave Griffiths <dave at pawfal.org> wrote:
>> >> Hi all,
>> >>
>> >> I'm interested in how the "break" key in drscheme is implemented - 
>> >> does
>> >> it
>> >> kill the (PLT?) thread which the process is currently running in? Is
>> >> this
>> >> the best/only way of manually stopping computation?
>> >>
>> >> In the context of mzscheme and embedding - I assume the only way to do
>> >> this is from inside the interpreter? i.e. there is no magic 
>> >> asynchronous
>> >> version of scheme_eval_string which can be stopped.
>> >>
>> >> cheers,
>> >>
>> >> dave
>> >>
>> >> http://www.pawfal.org/dave/
>> >>
>> >> _________________________________________________
>> >>   For list-related administrative tasks:
>> >>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> >>
>> >
>>
>>
>> http://www.pawfal.org/dave/
>>
>>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme 



Posted on the users mailing list.