↧
Answer by LWimsey for Which is more efficient, basic mutex lock or atomic...
A minimal (standards compliant) mutex implementation requires 2 basic ingredients: A way to atomically convey a state change between threads (the 'locked' state)memory barriers to enforce memory...
View ArticleAnswer by Gem Taylor for Which is more efficient, basic mutex lock or atomic...
Most processors have supported an atomic read or write, and often an atomic cmp&swap. This means that the processor itself writes or reads the latest value in a single operation, and there might be...
View ArticleAnswer by Sunil Singhal for Which is more efficient, basic mutex lock or...
Mutex is a kernel level semantic which provides mutual exclusion even at the Process level. Note that it can be helpful in extending mutual exclusion across process boundaries and not just within a...
View ArticleAnswer by RonTLV for Which is more efficient, basic mutex lock or atomic...
atomic integer is a user mode object there for it's much more efficient than a mutex which runs in kernel mode. The scope of atomic integer is a single application while the scope of the mutex is for...
View ArticleAnswer by Cort Ammon for Which is more efficient, basic mutex lock or atomic...
If you have a counter for which atomic operations are supported, it will be more efficient than a mutex.Technically, the atomic will lock the memory bus on most platforms. However, there are two...
View ArticleAnswer by yahe for Which is more efficient, basic mutex lock or atomic integer?
Atomic operations leverage processor support (compare and swap instructions) and don't use locks at all, whereas locks are more OS-dependent and perform differently on, for example, Win and Linux.Locks...
View ArticleAnswer by Ajay for Which is more efficient, basic mutex lock or atomic integer?
The atomic variable classes in Java are able to take advantage of Compare and swap instructions provided by the processor.Here's a detailed description of the differences:...
View ArticleWhich is more efficient, basic mutex lock or atomic integer?
For something simple like a counter if multiple threads will be increasing the number. I read that mutex locks can decrease efficiency since the threads have to wait. So, to me, an atomic counter would...
View Article