chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Please do not drop 'thread-terminate!' from the SRFI


From: F. Wittenberger
Subject: Re: [Chicken-users] Please do not drop 'thread-terminate!' from the SRFI 18 impl
Date: Sun, 10 Aug 2008 18:12:58 +0200

Am Sonntag, den 10.08.2008, 10:38 -0400 schrieb John Cowan:
> > a more relevant comparison (and answer) might be 'why don't we get
> > rid of 'kill -9'?'
...
> (except by debuggers that need to freeze threads so
> it can inspect their contents, something Scheme doesn't support):

That's what I think: there are - albeit few - situations, where forceful
termination of threads is just what the doctor ordered.

And why should a Scheme system not allow to debug it's threads?

> Because there are very few shared resources between processes, and
> the kernel knows how to clean them up (with the exception of terminal
> settings).

As long as - for instance - one does not mmap(, , ,MAP_SHARED, ,) a file
full of resources.  This argument does not take very far.

> Threads, by contrast, in principle share everything, and nobody knows
> how to clean up.

I'm taking a slightly different point of view: process systems as well
as thread systems define a few resources, which are handled consistent.
Other resources may become damaged if not handled properly.

Forceful termination has it's uses, no matter how dangerous it might be
under certain circumstances.

[Example, taking the source I'm just porting: there are two uses of
forceful termination.  a) Stop a thread waiting for i/o - this one could
be done better in chicken.  b) Terminate typically extremely short but
potentially long running untrusted code.  This code is pure/side effect
free - *because* it might get terminated by brute force; so all
arguments about damaged data are void in this context.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]