Re: atomic RAM ?

From: Alan Cox
Date: Fri Apr 09 2010 - 09:11:40 EST


> If you think it could be done with NIOS: using store ordering, how can I
> implement a pthread_mutex_..() workalike ?

Lamport's Bakery is the classic algorithm for doing this. It has very
minimal assumptions about visibility of writes and the order they are
seen so should certainly work uniprocessor and may work SMP depending
upon the cache coherency rules.

It doesn't scale well to large numbers of threads however.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/