This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Semantics of `exit' - exit thread or application?


I'm doing the final part of some face-lifting of Guile's threads
interface.  (Making it easier for Niibe to introduce the POSIX
support, making it possible to support run-time choice of thread
package in a future release, and, making it easy to interface Guile to
GLib's thread support.)

I now want to introduce the operation corresponding to the
`pthread_exit' call.

The behaviour of current Guile is this: When the last thread is
finished, the Guile application exits.  It therefore seems natural to
let `(exit RESULT)' mean "exit the current thread with result RESULT".

This is a natural generalization of `exit' to threads.

But I can imagine that it sometimes would be nice to be able to exit
the application, no regard what threads are running.  In this respect,
maybe `(exit RESULT)' should mean "kill all threads and exit the
application with result RESULT", and "exit current thread" should be
called `thread-exit' instead...

Opinions?  (Everbody can join.)

/mdj