1.0.37.44: FIND-PACKAGE and FIND-SYMBOL deadlocks
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 6 Apr 2010 15:11:02 +0000 (15:11 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 6 Apr 2010 15:11:02 +0000 (15:11 +0000)
commitb400484e0aa71c263c456fe7c85f80ed5661bff1
tree4abd887f89d0916f7e67031adab11e4ad5198d29
parentd5e1f093b8ca643ce4f39554232e0a1688e85b7c
1.0.37.44: FIND-PACKAGE and FIND-SYMBOL deadlocks

 * Instead of linearizing purely on *PACKAGE-LOCK* split the
   responsibilities:

     1) *PACKAGE-GRAPH-LOCK* is responsible for package->package
     links, and package->symbol links.

     2) The hash-table lock on *PACKAGE-NAMES* is responsible for
     string->package associations. (%NAME and %NICKNAMES slots of
     package objects and the hash-table itself.)

   This is enough to allow FIND-SYMBOL and FIND-PACKAGE to always
   complete in finite time. INTERN, etc, can still block if eg.  the
   *PACKAGE-GRAPH-LOCK* is held by a thread waiting for the debugger,
   etc -- but the reader is at least able to read existing symbols.

 * Additionally, in cases where it is easy, signal some errors while
   *PACKAGE-GRAPH-LOCK* is not held.
NEWS
src/code/defpackage.lisp
src/code/package.lisp
src/code/target-package.lisp
tests/packages.impure.lisp
version.lisp-expr