Changeset 8229


Ignore:
Timestamp:
Jan 20, 2008, 9:20:15 PM (12 years ago)
Author:
andreas
Message:

Lock-free STATIC-CONS for x86.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/X86/x86-misc.lisp

    r8197 r8229  
    782782 
    783783
     784(defx86lapfunction %atomic-pop-static-cons ()
     785  @again
     786  (movq (@ (+ x8664::nil-value (x8664::kernel-global static-conses))) (% rax))
     787  (testq ($ x8664::nil-value) (% rax))
     788  (jz @lose)
     789  (%cdr rax temp0)
     790  (lock)
     791  (cmpxchgq (% temp0) (@ (+ x8664::nil-value (x8664::kernel-global static-conses))))
     792  (jnz @again)
     793  @lose
     794  (movq (% rax) (% arg_z))
     795  (single-value-return))
    784796 
    785797
  • trunk/source/lib/misc.lisp

    r8226 r8229  
    809809  "Activates collection of garbage conses in the static-conses
    810810   list and allocates initial static conses."
    811   (without-interrupts
    812    (%lock-gc-lock)
    813    ; Another thread might have called initialize already
    814    (when (eq (%get-kernel-global 'static-conses) 0)
    815      (%set-kernel-global 'static-conses nil))
    816    (%unlock-gc-lock))
     811  ; There might be a race here when multiple threads call this
     812  ; function.  However, the discarded static conses will become
     813  ; garbage and be added right back to the list.  No harm here
     814  ; except for additional garbage collections.
     815  (%set-kernel-global 'static-conses nil)
    817816  (allocate-static-conses))
    818817
     
    842841  (when (eq (%get-kernel-global 'static-conses) 0)
    843842    (initialize-static-cons))
    844   (let ((cell (atomic-pop-kernel-global 'static-conses)))
     843  (let ((cell #-x8664-target (atomic-pop-kernel-global 'static-conses)
     844              #+x8664-target (%atomic-pop-static-cons)))
    845845    (if cell
    846846      (progn
Note: See TracChangeset for help on using the changeset viewer.