[plt-scheme] Threading vs. System Threads
At Wed, 12 Feb 2003 13:38:01 -0600, Robert Bruce Findler wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> At Wed, 12 Feb 2003 13:55:17 -0500 (EST), Paul Graunke wrote:
> > At Wed, 12 Feb 2003 11:10:59 -0600, Robert Bruce Findler wrote:
> > > For list-related administrative tasks:
> > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > >
> > > How do you handle killing of threads? That is, in the face of
> > > custodian-shutdown-all or kill-thread, can messages appear multiple
> > > times or can internal queues get put into bad states (deadlock)?
> > >
> > > Robby
> >
> > I suspect ending up in a bad state will be much less of a problem
> > in a cooperative multitasking system. If nobody can interrupt your
> > thread until it yields, nobody else can be running to kill your thread
> > at an un-opportune moment.
>
> Right, of course. I saw the message passing primitives and forgot about
> the cooperation -- I'm dying to get something better in the DrScheme
> REPL implementation, but it won't work with only cooperation (since the
> Kill button is a critical part of the IDE)
>
> Robby
If message passing is such a widespread, useful means of communicating between
threads (Erlang stuff, the Web server, DrScheme's REPL, the Stepper?) then
we should really have a mechanism that works well with custodians. Maybe
there is some clever way to use call-in-nested-thread to make a thread
that won't die do the queue manipulation. Maybe mzscheme could provide
atomic queue opperations. Maybe that's what queue-callback is for already.
I'll add it to my never-ending list of odd things to think about, unless
someone else already knows the answer.
Paul