Permalink
Browse files

0.9.13.22:

	Implement SB-THREAD mutexes and waitqueues using only pthread
        functionality on platforms that don't support Linux futexes. New
        platforms that can be compiled with SB-THREAD:

          * Solaris/x86 (seems to be as stable as SBCL threads on Linux)
          * OS X/x86 (some known stability problems, but doesn't fail on the
            thread regression tests every time)
          * FreeBSD/x86 (reportedly "flat-out broken", tends to cause
            kernel panics)

        While I (Juho) am doing the final merge from lutex-branch to
        HEAD, much of the work was done by Cyrus Harmon, based on an
        initial implementation by Nathan Froyd. The Solaris work was
        funded by Tellme Networks, Inc.
  • Loading branch information...
1 parent 9b458bf commit 402958f92506b9d3de852601b8c1ccb99b5ee558 @jsnell jsnell committed Jun 3, 2006
Showing with 1,558 additions and 170 deletions.
  1. +2 −0 NEWS
  2. +16 −0 base-target-features.lisp-expr
  3. +10 −1 make-config.sh
  4. +2 −0 package-data-list.lisp-expr
  5. +2 −0 src/code/pred.lisp
  6. +147 −48 src/code/target-thread.lisp
  7. +4 −1 src/code/thread.lisp
  8. +4 −1 src/cold/defun-load-or-cload-xcompiler.lisp
  9. +4 −1 src/compiler/generic/early-objdef.lisp
  10. +2 −0 src/compiler/generic/genesis.lisp
  11. +4 −0 src/compiler/generic/late-type-vops.lisp
  12. +14 −0 src/compiler/generic/objdef.lisp
  13. +7 −0 src/compiler/generic/vm-fndb.lisp
  14. +1 −1 src/runtime/Config.x86-darwin
  15. +3 −0 src/runtime/Config.x86-freebsd
  16. +2 −2 src/runtime/Config.x86-sunos
  17. +2 −2 src/runtime/GNUmakefile
  18. +20 −30 src/runtime/bsd-os.c
  19. +5 −18 src/runtime/bsd-os.h
  20. +41 −0 src/runtime/coreparse.c
  21. +2 −0 src/runtime/darwin-os.c
  22. +32 −0 src/runtime/darwin-os.h
  23. +258 −9 src/runtime/gencgc.c
  24. +101 −15 src/runtime/interrupt.c
  25. +1 −0 src/runtime/interrupt.h
  26. +5 −3 src/runtime/linux-os.c
  27. +1 −1 src/runtime/linux-os.h
  28. +161 −0 src/runtime/pthread-lutex.c
  29. +8 −0 src/runtime/purify.c
  30. +100 −0 src/runtime/save.c
  31. +9 −6 src/runtime/sunos-os.c
  32. +5 −0 src/runtime/sunos-os.h
  33. +131 −19 src/runtime/thread.c
  34. +12 −3 src/runtime/thread.h
  35. +4 −1 src/runtime/x86-arch.c
  36. +16 −0 src/runtime/x86-arch.h
  37. +55 −0 src/runtime/x86-assem.S
  38. +106 −2 src/runtime/x86-bsd-os.c
  39. +10 −0 src/runtime/x86-bsd-os.h
  40. +92 −0 src/runtime/x86-darwin-os.c
  41. +8 −0 src/runtime/x86-darwin-os.h
  42. +100 −3 src/runtime/x86-sunos-os.c
  43. +48 −2 tests/threads.impure.lisp
  44. +1 −1 version.lisp-expr
View
@@ -1,5 +1,7 @@
;;;; -*- coding: utf-8; -*-
changes in sbcl-0.9.14 relative to sbcl-0.9.13:
+ * feature: thread support on Solaris/x86, and experimental thread support
+ on OS X/x86.
* minor incompatible change: prevent the user from specializing the
new-value argument to SB-MOP:SLOT-VALUE-USING-CLASS. It's
somewhat counter to the intent of the protocol, I (CSR) think, and
@@ -162,6 +162,22 @@
;; so caveat executor.
; :sb-thread
+ ;; lutex support
+ ;;
+ ;; While on linux we are able to use futexes for our locking
+ ;; primitive, on other platforms we don't have this luxury. NJF's
+ ;; lutexes present a locking API similar to the futex-based API that
+ ;; allows for sb-thread support on x86 OS X, Solaris and
+ ;; FreeBSD.
+ ;;
+ ; :sb-lutex
+
+ ;; On some operating systems the FS segment register (used for SBCL's
+ ;; thread local storage) is not reliably preserved in signal
+ ;; handlers, so we need to restore its value from the pthread thread
+ ;; local storage.
+ ; :restore-tls-segment-register-from-tls
+
;; Support for detection of unportable code (when applied to the
;; COMMON-LISP package, or SBCL-internal pacakges) or bad-neighbourly
;; code (when applied to user-level packages), relating to material
View
@@ -184,6 +184,9 @@ case "$sbcl_os" in
freebsd)
printf ' :elf' >> $ltf
printf ' :freebsd' >> $ltf
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :sb-lutex :restore-tls-segment-register-from-tls' >> $ltf
+ fi
link_or_copy Config.$sbcl_arch-freebsd Config
;;
openbsd)
@@ -205,14 +208,20 @@ case "$sbcl_os" in
darwin)
printf ' :mach-o' >> $ltf
printf ' :bsd' >> $ltf
+ printf ' :darwin' >> $ltf
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :sb-lutex :restore-fs-segment-register-from-tls' >> $ltf
+ fi
link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
link_or_copy bsd-os.h target-os.h
- printf ' :darwin' >> $ltf
link_or_copy Config.$sbcl_arch-darwin Config
;;
sunos)
printf ' :elf' >> $ltf
printf ' :sunos' >> $ltf
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :sb-lutex' >> $ltf
+ fi
link_or_copy Config.$sbcl_arch-sunos Config
link_or_copy $sbcl_arch-sunos-os.h target-arch-os.h
link_or_copy sunos-os.h target-os.h
@@ -538,6 +538,7 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*."
"INITIAL-FUN-CORE-ENTRY-TYPE-CODE"
"*!LOAD-TIME-VALUES*"
"LOAD-TYPE-PREDICATE"
+ #!+(and sb-thread sb-lutex) "LUTEX-TABLE-CORE-ENTRY-TYPE-CODE"
"NEW-DIRECTORY-CORE-ENTRY-TYPE-CODE"
"OPEN-FASL-OUTPUT" "PAGE-TABLE-CORE-ENTRY-TYPE-CODE"
"READ-ONLY-CORE-SPACE-ID"
@@ -2201,6 +2202,7 @@ structure representations"
#!+long-float "LONG-STACK-SC-NUMBER"
"LOWTAG-LIMIT" "LOWTAG-MASK"
"LRA-SAVE-OFFSET"
+ #!+(and sb-thread sb-lutex) "LUTEX-WIDETAG"
"MEMORY-USAGE" "MOST-POSITIVE-COST"
"N-LOWTAG-BITS"
"N-FIXNUM-TAG-BITS"
View
@@ -74,6 +74,8 @@
(def-type-predicate-wrapper integerp)
(def-type-predicate-wrapper listp)
(def-type-predicate-wrapper long-float-p)
+ #!+(and sb-thread sb-lutex)
+ (def-type-predicate-wrapper lutexp)
(def-type-predicate-wrapper lra-p)
(def-type-predicate-wrapper null)
(def-type-predicate-wrapper numberp)
Oops, something went wrong.

0 comments on commit 402958f

Please sign in to comment.