1.0.6.7: thread-safe UPDATE-DFUN
commit776a2f1275624352bbba37b03dabea03ec13a9e5
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 30 May 2007 13:55:59 +0000 (30 13:55 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 30 May 2007 13:55:59 +0000 (30 13:55 +0000)
tree943eaac4dc6bb8c17e39ccabea8a21b6e310d7d7
parent25a4ce7810afffbbefa4e579d017e0da45b159a3
1.0.6.7: thread-safe UPDATE-DFUN

 * Make GET-SPINLOCK detect unwanted recursion. Despite the old
   comments in GET/RELEASE-SPINLOCK, we can store EQ-comperable lisp
   objects in SPINLOCK-VALUE -- just like we do for mutexes.
   (Potentially freshly consed bignums that the old comments referred
   to are not sanely EQ-comperable, of course.)

 * Implement WITH-RECURSIVE-SPINLOCK.

 * Adjust thread.impure.lisp accordingly.

 * Add a per generic function spinlock. (We could use mutexes, but
   since contention is presumed to be rare we don't want to pay the
   wakeup syscall cost for every UPDATE-DFUN call: if and when our
   mutexes get smart doing the wakeup only when there are threads
   waiting we can and should switch this -- and probably almost all
   uses of spinlocks -- to mutexes.) This spinlock is grabbed to
   ensure that the dfun state, fin function, and name are all updated
   atomically.
NEWS
src/code/target-thread.lisp
src/code/thread.lisp
src/pcl/defs.lisp
src/pcl/dfun.lisp
tests/threads.impure.lisp
version.lisp-expr