Really, mutex op is quite fast (I guess max 3 instructions on most CPUs), so - is it really _so_ bad?
Is that true for multi-cpu machines also?
A pthreads mutex operation does not only affect the mutex structure itself, but also issue any needed instruction to get the caches of the involved cpu:s into a consistent state. How much work that is is pretty architecture dependent.
/ Niels Möller (vässar rödpennan)
Previous text:
2004-02-03 11:12: Subject: Re: Default backend and thread backends?
On Tue, Feb 03, 2004 at 07:25:04AM +0100, Fredrik (Naranek) Hubinette (Real Build Master) @ Pike (-) developers forum wrote:
However, I'm still not entirely sure that this will be fast enough to be worth it. There will still be a lot of locking operations,
Most apps are single-threaded, so mutex ops will be no-ops effectively, but for those apps where multi-threading is important, the gain could overweight the loss, I guess.
Really, mutex op is quite fast (I guess max 3 instructions on most CPUs), so - is it really _so_ bad?
Regards, /Al
/ Brevbäraren