Preliminary work towards threads on win32
authorDavid Lichteblau <david@lichteblau.com>
Tue, 18 Sep 2012 15:12:09 +0000 (17:12 +0200)
committerDavid Lichteblau <david@lichteblau.com>
Fri, 5 Oct 2012 19:38:38 +0000 (21:38 +0200)
commit7aef55b130d95c384b63422807f1848faa9aba5a
treeca6388c9640b336fbba863e8b92bb5a135b83897
parent1dd3616e9eadaba9f1ca86b72d64551fbd75f399
Preliminary work towards threads on win32

  * Implement SB-THREAD

  * Support WITH-TIMEOUT, etc.

Implementation details:

  * Implement pthreads, futex API on top of Win32.
  * Adds support for the timer facility using sb-wtimer.
  * Implement an interruptable `nanosleep' using waitable timers.
  * Threading on Windows uses safepoints to stop the world.
    On this platform, either all or none of :SB-THREAD, :SB-SAFEPOINT,
    :SB-THRUPT, and :SB-WTIMER need to be enabled together.
  * On this platform, INTERRUPT-THREAD will not run interruptions
    in a target thread that is executing foreign code, even though
    the POSIX version of sb-thrupt still allows this (potentially
    unsafe) form of signalling by default.

Does not yet include interruptible I/O, which will be made available
separately.  Slime users are requested to build SBCL without threads
until then.

Note that these changes alone are not yet sufficient to make SBCL on
Windows an ideal backend.  Users looking for a particularly stable
or thread-enabled version of SBCL for Windows are still advised to
use the well-known Windows branch instead.

This is a merge of features developed earlier by Dmitry Kalyanov and
Anton Kovalenko.
32 files changed:
src/code/cold-init.lisp
src/code/run-program.lisp
src/code/target-exception.lisp
src/code/target-thread.lisp
src/code/toplevel.lisp
src/code/win32.lisp
src/compiler/generic/objdef.lisp
src/runtime/Config.x86-win32
src/runtime/gencgc.c
src/runtime/interrupt.c
src/runtime/interrupt.h
src/runtime/os-common.c
src/runtime/parse.c
src/runtime/print.c
src/runtime/pthreads_win32.c [new file with mode: 0644]
src/runtime/pthreads_win32.h [new file with mode: 0644]
src/runtime/runtime.c
src/runtime/runtime.h
src/runtime/safepoint.c
src/runtime/save.c
src/runtime/thread.c
src/runtime/thread.h
src/runtime/win32-os.c
src/runtime/win32-os.h
src/runtime/win32-thread-private-events.h [new file with mode: 0644]
src/runtime/wrap.c
src/runtime/x86-arch.c
src/runtime/x86-arch.h
src/runtime/x86-assem.S
src/runtime/x86-win32-os.c
src/runtime/x86-win32-os.h
tools-for-build/grovel-headers.c