Use safepoints for INTERRUPT-THREAD
authorDavid Lichteblau <david@lichteblau.com>
Fri, 17 Jun 2011 12:17:07 +0000 (14:17 +0200)
committerDavid Lichteblau <david@lichteblau.com>
Fri, 10 Aug 2012 18:54:28 +0000 (20:54 +0200)
commitdd54f9e004a0a83d1328e94648f48dcc27e0be5b
tree9a2f20263d9e3436edf6c007cc3bf8d818e919c8
parente6f4c7523aa628ece995ee01879d3fb90eed6d9f
Use safepoints for INTERRUPT-THREAD

  * In INTERRUPT-THREAD, stop threads using safepoints instead of
    signals.

  * Currently not used by default.  Users need to set feature
    SB-THRUPTION to enable this code.  SB-THRUPTION should only be set
    when SB-SAFEPOINT is also enabled.

  * This feature should ultimately be rolled into SB-SAFEPOINT, but
    remains as a separate build option until both versions are equally
    well-tested, and until other avoidable uses of signals have also
    been replaced by safepoints.

  * On the term "thruption": Earlier work on this feature sometimes
    used "interrupt" to refer to INTERRUPT-THREAD, causing confusion
    with the traditional meaning of "interrupt" as POSIX signal or WIN32
    exception.  To avoid such confusion, the runtime now refers to
    INTERRUPT-THREAD as a "thruption", short for th(read) (inter)ruption.

  * SIGPIPE is not used for threads running Lisp code, but a low-level
    handler for SIGPIPE still exists which arranges for threads running
    FFI code (in particular, threads blocked in poll, select,
    futex_wait) to be interrupted.

  * OS support: Minor changes to signal handling required, currently
    implemented for Linux and Solaris.

Credits: This is a POSIX backport of Windows threading changes by
Anton Kovalenko and Dmitry Kalyanov.
16 files changed:
package-data-list.lisp-expr
src/code/cold-init.lisp
src/code/early-impl.lisp
src/code/signal.lisp
src/code/target-signal.lisp
src/code/target-thread.lisp
src/code/toplevel.lisp
src/compiler/generic/parms.lisp
src/runtime/interrupt.c
src/runtime/interrupt.h
src/runtime/linux-os.c
src/runtime/safepoint.c
src/runtime/sunos-os.c
src/runtime/thread.c
src/runtime/thread.h
tests/kill-non-lisp-thread.impure.lisp