with-gcing doesn't allow thread start
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
As it is now, you cannot start threads when you are inside without-gcing.
It doesn't look like the code has too hard obstacles for this. Here is the appropriate section and the comment. <== HERE
(defun make-thread (function &key name arguments ephemeral)
[...]
;; If the starting thread is stopped for gc before it signals
;; the semaphore then we'd be stuck.
(assert (not *gc-inhibit*)) <== HERE
;; Keep INITIAL-FUNCTION in the dynamic extent until the child
;; thread is initialized properly. Wrap the whole thing in
;; WITHOUT-INTERRUPTS because we pass INITIAL-FUNCTION to
;; another thread.
(if (zerop
(setf thread nil)
This is a bugging me a bit since I like to run basic performance tests from the repl, and they get much more accurate without GC. It isn't so much the GCing itself that randomizes time, the problem is that the resulting placement new data is so random. Between TLB misses, cache line boundaries, assorted other alignments, NUMA and even paging it is overall better (not good, but better) do do no GC.
I currently work around this by setting gc-threshold very high. Looking for opinions or other people in the same situation.
Changed in sbcl: | |
status: | New → Fix Released |