Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [d6f967] Maximize Restore History

killing lutexes, adding timeouts

* Remove all lutex-specific code from the system.
** Use SB-FUTEX for futex-capable platforms, and plain SB-THREAD
otherwise.
** Make non-futex mutexes unfair spinlocks for now, using WAIT-FOR to
provide timeouts and backoff.
** Build non-futex condition variables on top of a queue and WAIT-FOR.

Performance implications: SB-FUTEX builds should perform pretty much the
same, or improve a bit. Threaded non-futex builds are affected as follows:

1. Threads idling on semaphores or condition variables aren't quite as
cheap. Just how costly depends on the OS. On Darwin 1000 idle threads
can chew up a bit over 50% CPU. I will try to address this later.

2. Contested locking around operations that take considerably longer
than a single timeslice suffers mild degradation.

3. Contested locking around operations that don't take long is an order
of magnitude performant.

4. Highly active semaphores perform much better. (Follows from #3.)

* GRAB-MUTEX gets timeout support on all platforms.

* CONDITION-WAIT gets timeout support.

* Disable a bunch of prone-to-hang thread tests on Darwin. (All of them
were already prone to hang prior to this commit.)

* Enable a bunch tests that now /pass/ on Darwin. \o/ This doesn't mean that
the threaded Darwin is fully expected to pass all tests yet, but let's say
it's more likely to do so.

...but still not robust enough to enable threads on Darwin by default.

* GET-MUTEX/GRAB-MUTEX get refactored into two main parts: %TRY-MUTEX and
%WAIT-ON-MUTEX, which are also used directly from CONDITION-WAIT where
appropriate.

Nikodemus Siivola Nikodemus Siivola 2011-08-16

1 2 > >> (Page 1 of 2)
removed src/runtime/pthread-lutex.c
removed src/runtime/pthread-lutex.h
changed base-target-features.lisp-expr
changed contrib
changed contrib/sb-introspect
changed contrib/sb-introspect/introspect.lisp
changed make-config.sh
changed package-data-list.lisp-expr
changed src
changed src/code
changed src/code/cross-thread.lisp
changed src/code/deadline.lisp
changed src/code/gc.lisp
changed src/code/late-extensions.lisp
changed src/code/pred.lisp
changed src/code/primordial-extensions.lisp
changed src/code/target-thread.lisp
changed src/code/thread.lisp
changed src/compiler
changed src/compiler/generic
changed src/compiler/generic/early-objdef.lisp
changed src/compiler/generic/genesis.lisp
changed src/compiler/generic/late-type-vops.lisp
changed src/compiler/generic/objdef.lisp
changed src/compiler/generic/vm-fndb.lisp
changed src/runtime
changed src/runtime/GNUmakefile
changed src/runtime/coreparse.c
changed src/runtime/gencgc.c
changed src/runtime/gencgc.h
changed src/runtime/purify.c
changed src/runtime/save.c
changed tests
changed tests/deadline.impure.lisp
changed tests/debug.impure.lisp
changed tests/test-util.lisp
changed tests/threads.impure.lisp
changed tests/threads.pure.lisp
src/runtime/pthread-lutex.c
File was removed.
src/runtime/pthread-lutex.h
File was removed.
base-target-features.lisp-expr Diff Switch to side-by-side view
Loading...
contrib
Directory.
contrib/sb-introspect/introspect.lisp Diff Switch to side-by-side view
Loading...
make-config.sh Diff Switch to side-by-side view
Loading...
package-data-list.lisp-expr Diff Switch to side-by-side view
Loading...
src
Directory.
src/code
Directory.
src/code/cross-thread.lisp Diff Switch to side-by-side view
Loading...
src/code/deadline.lisp Diff Switch to side-by-side view
Loading...
src/code/gc.lisp Diff Switch to side-by-side view
Loading...
src/code/late-extensions.lisp Diff Switch to side-by-side view
Loading...
src/code/pred.lisp Diff Switch to side-by-side view
Loading...
src/code/primordial-extensions.lisp Diff Switch to side-by-side view
Loading...
src/code/target-thread.lisp Diff Switch to side-by-side view
Loading...
src/code/thread.lisp Diff Switch to side-by-side view
Loading...
src/compiler
Directory.
src/compiler/generic/early-objdef.lisp Diff Switch to side-by-side view
Loading...
src/compiler/generic/genesis.lisp Diff Switch to side-by-side view
Loading...
src/compiler/generic/late-type-vops.lisp Diff Switch to side-by-side view
Loading...
src/compiler/generic/objdef.lisp Diff Switch to side-by-side view
Loading...
src/compiler/generic/vm-fndb.lisp Diff Switch to side-by-side view
Loading...
src/runtime
Directory.
src/runtime/GNUmakefile Diff Switch to side-by-side view
Loading...
src/runtime/coreparse.c Diff Switch to side-by-side view
Loading...
src/runtime/gencgc.c Diff Switch to side-by-side view
Loading...
src/runtime/gencgc.h Diff Switch to side-by-side view
Loading...
src/runtime/purify.c Diff Switch to side-by-side view
Loading...
src/runtime/save.c Diff Switch to side-by-side view
Loading...
tests
Directory.
tests/deadline.impure.lisp Diff Switch to side-by-side view
Loading...
tests/debug.impure.lisp Diff Switch to side-by-side view
Loading...
tests/test-util.lisp Diff Switch to side-by-side view
Loading...
tests/threads.impure.lisp Diff Switch to side-by-side view
Loading...
tests/threads.pure.lisp Diff Switch to side-by-side view
Loading...
1 2 > >> (Page 1 of 2)