Small world, how so?
Quote:
Originally Posted by
gorga
I hadn't heard of futexes until you mentioned them, but I did some reading and it seems they still use atomic instructions to update shared variables.
Well, yes. It has to synchronize
somehow. One way or another you must interrupt other cores with this change in status, or they may never know.
Wow, those are nice.
Quote:
The thing with these is they use the asm op-code "lock", which issues a hardware lock on the data-bus effectively locking every other process out of memory.
I think you're overreacting...
Any memory I/O monopolizes the bus
*, LOCK just guarantees one instruction gets two ops in a row.
Also. The original 8088 has precisely
one instruction worth of cache, so locking the bus stalls it instantly... The huge caches, multiple
independent memory buses, and cache communication systems in recent NUMA systems usually let cores keep going or find something else to do. I'm not sure LOCK XCGH even forces a real memory fetch anymore(might be simple to test, try to get back to you on that.)
Lastly, if you're doing no mutexing, what are you doing instead -- polling? That's not going to be more efficient, untold amounts of CPU will be expended on what amounts to a while(1) loop.
I really think pthreads is still what you're looking for. They've made it as fast as they know how, significantly changing the kernel to accommodate it.
* Exceptions exist for very special-purpose memory chips like video RAM.