Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19460/tests
Modified Files:
threads.pure.lisp
Log Message:
1.0.15.31: thread-safe FIND-CLASS -- really this time
Call It Myopia: it turns out FIND-CLASSOID &co underneath FIND-CLASS
(when called for non-existent classes) were not thread-safe either.
* Get rid of *FIND-CLASS* hash-table, moving the actual PCL classes into
corresponding CLASSOID-CELL (new slot PCL-CLASS).
* Move classoid-cells from the infodb into into *CLASSOID-CELLS*
hash-table. We want to be able to lock around
(or (get-cell) (setf (get-cell) (make-cell)))
and infodb isn't really designed for that. This is the crux of
the breakage:
*** parallel writes to infodb are not thread safe! ***
* Lock over *CLASSOID-CELLS* and *FORWARD-REFERENCED-LAYOUTS*. The
latter should not be really necessary as long as we don't
assume (SETF FIND-CLASS) to be thread-safe, but easier to reason
about it this way. ...and it would be nice for the SETF to be safe
as well.
Related work:
* Don't create cells for non-exitent classes unless we know we are
going to need them -- previously both FIND-CLASSOID and FIND-CLASS
created a cell for every name they were called with, which is
isn't too good. This is especially important as once created these
cells never go away!
Index: threads.pure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/threads.pure.lisp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- threads.pure.lisp 13 Mar 2008 18:35:49 -0000 1.4
+++ threads.pure.lisp 14 Mar 2008 19:03:07 -0000 1.5
@@ -56,8 +56,7 @@
#+sb-thread
(with-test (:name without-interrupts+get-mutex)
(let* ((lock (make-mutex))
- (foo (get-mutex lock))
- (bar nil)
+ (bar (progn (get-mutex lock) nil))
(thread (make-thread (lambda ()
(sb-sys:without-interrupts
(with-mutex (lock)
|