[ros-dev] Mayday ... Critical Section problems
jimtabor at adsl-64-217-116-74.dsl.hstntx.swbell.net
Wed Nov 1 21:11:34 CET 2006
Rick Parrish wrote:
> Alex Ionescu wrote:
>>Rick Parrish wrote:
>>>Try this ... add a call to Sleep(0) just before attempting to acquire
>>>the lock. That *may* produce better average performance.
>>You should never use Sleep(0), that's a horrible suggestion.
>>Use Sleep(1) and/or, SwitchToThread(), and/or YieldProcessor() and /or
> Thanks Alex. I'll have to check these out.
> Oh, and Timo's suggestion is very retro (but very valid) if you remember
> VAX-11 architecture.
> (wandering off topic)
Yes, it's old school,,, sleep 0 just allows another process (thread) to run and
put the one you are running back on top of the "ready to run list". With M$ coding
it's all different now.
More information about the Ros-dev