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: John Cowan
Subject: Re: [Chicken-users] Please do not drop 'thread-terminate!' from the SRFI 18 impl
Date: Sun, 10 Aug 2008 10:38:22 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Elf scripsit:

> you cant take the car or cdr of an atomic object: the slots dont exist.

And yet in CL and all the way back to Lisp 1.5, (car nil) = (cdr nil) = nil.
In pre-CL Lisps, the CDR of a symbol was its property list; CL finally
abolished that.

> these arent relevant comparisons.  more relevant comparisons would be other
> thread/concurrency systems: do any not allow threads to be killed?

As I pointed out before, Java has deprecated suspend and terminate:
http://java.sun.com/javase/6/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html

Here's Microsoft's own discussion of why ThreadSuspend should
not be used (except by debuggers that need to freeze threads so
it can inspect their contents, something Scheme doesn't support):
http://msdn.microsoft.com/en-us/library/ms686345(VS.85).aspx
Consequently, the .NET version is deprecated.  (Note that
thread-terminate! is the same as a thread-suspend! that is never resumed,
so one argument applies to both.)

POSIX threads have no suspend at all.  (Some implementations add it.)

Cygwin provides its own threading package, documented at
http://www.navosha.com/ecos/c/cyg_thread.html .  The suspend and
terminate functions are marked dangerous, for the same old reasons.

In short, everyone provides suspension for backward compatibility with their
thread-naive definitions, everyone deprecates it or strongly discourages
its use.  It is Considered Harmful.  It should go.

> a more relevant comparison (and answer) might be 'why don't we get
> rid of 'kill -9'?'

Because there are very few shared resources between processes, and
the kernel knows how to clean them up (with the exception of terminal
settings).  Threads, by contrast, in principle share everything, and
nobody knows how to clean up.

> i dont think removing necessary, albeit dangerous (atm), functionality
> is a good idea.

Lispers spent decades thinking dynamic binding of lambda variables was
necessary functionality even after they were finally convinced it was
dangerous.  Part of what made Scheme revolutionary was that it threw
that functionality away (and CL followed, breaking with the past).

-- 
Yes, chili in the eye is bad, but so is your    John Cowan
ear.  However, I would suggest you wash your    address@hidden
hands thoroughly before going to the toilet.    http://www.ccil.org/~cowan
        --gadicath




reply via email to

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