[concurrency-interest] Lock-free mania

Szabolcs Ferenczi szabolcs.ferenczi at gmail.com
Mon Apr 16 16:27:26 EDT 2007

On 16/04/07, David Holmes <dcholmes at optusnet.com.au> wrote:

> .... Taking threads off processors and placing them back later
> incurs a lot of overheads, cools caches etc and can greatly lower
> concurrency.

It depends on the hardware. For instance, if a processor is especially
designed for multi-tasking, context switch can be very inexpensive. An
example was the Transputer where a context switch is comparable to any
other instruction time. Well, it was not  a business success story but
it indicates that if hardware designers want, they can make the
context switch very inexpensive. And soon they will want it.

Surprisingly, however, hardware technology develops faster than
software technology. If you hard wire your algorithms for today's
hardware technology, and you do it with the so-called lock-free
algorithm, soon you get into trouble. The thought to be efficient
algorithm becomes very inefficient.

In fact, you are already in trouble because a lock-free algorithm is
more complicated and less testable than a comparable algorithm that
uses abstractions like critical section. And you gain practically
nothing. You only have the illusion that you have control over

Best Regards,

More information about the Concurrency-interest mailing list