Changeset 10751


Ignore:
Timestamp:
Sep 15, 2008, 8:31:02 PM (11 years ago)
Author:
gz
Message:

Allow :lock-free arg to make-hash-table to be :shared, meaning use the lock-free algorithm for shared tables and the regular algorithm for unshared tables. FWIW, when that is the default, (compile-file ccl:compiler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-hash.lisp

    r10731 r10751  
    409409before doing so.")
    410410
    411 (defparameter *lock-free-hash-table-default* #+(or gz ccl-0711) t #-(or gz ccl-0711) nil)
     411(defparameter *lock-free-hash-table-default* #+(or gz ccl-0711) :shared #-(or gz ccl-0711) nil
     412  "If NIL, hash tables default to using the standard algorithms, with locks for shared tables.
     413   If :SHARED, shared hash tables default to using the \"lock-free\" algorithm,
     414   which is faster for typical access but slower for rehashing or growing the table.
     415   Otherwise, all hash tables default to the lock-free algorithm")
    412416
    413417(defun make-hash-table (&key (test 'eql)
     
    443447    (report-bad-arg rehash-size '(or fixnum (real 1 *))))
    444448  (unless (fixnump size) (report-bad-arg size 'fixnum))
     449  (when (and (eq lock-free :shared) (not shared))
     450    (setq lock-free nil))
    445451  (setq rehash-threshold (/ 1.0 (max 0.01 rehash-threshold)))
    446452  (let* ((default-hash-function
Note: See TracChangeset for help on using the changeset viewer.