Initial state of gc_thread.mut_spin

Patrick Palka patrick
Tue Oct 1 16:11:13 UTC 2013


Hi everyone,

In new_gc_thread(), why is gc_thread.mut_spin initialized to the 'released'
state instead of the 'acquired' state (as with gc_spin)? I think this is
wrong for two reasons:

1. During the first GC (but not during subsequent GCs), gcWorkerThread()
releases mut_spin but mut_spin is not 'acquired' at this point.
2. The initial state of mut_spin is inconsistent with the final state of
mut_spin at the end of a GC (it is in the 'acquired' state then).

So it seems to me that mut_spin should be initialized to the 'acquired'
state, like gc_spin is. Doing so would address these two points.

Does this change make sense?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131001/a829151d/attachment.html>



More information about the ghc-devs mailing list