Re: Reasonable values for CRITICAL_SECTION spin-count
Tech-Archive recommends: Fix windows errors by optimizing your registry
Has anyone some information on reasonable values for the spin-count
parameter for CRITICAL_SECTIONs? I'm assuming that the CRITICAL_SECTION
is held only for a small number of instructions, i.e. below 100 and that
none of these instruction imposes a large stall to the processing while
the CRITICAL_SECTION is held.
I have a nice idea: I simply measure the time a WaitForSingleObjectObject on
an event-object which is initially set (maybe a hundred times in a loop and
take the smallest value) in clock-cycles and set the spin-parameter so that
the default-spinning takes half the time of a WaitForSingleObject.
.