|
|
|
|
|
by viraptor
5645 days ago
|
|
> ..., atomic-free synchronization algorithms Actually I'm not sure if it was supposed to be funny or serious. I see the funny "everything-free" list, as well as can imagine that there is some action you can do not atomically (relative to other actions) that gives you synchronisation. Anyone? |
|
An example of mutual exclusion, without any atomic operations, taken from the book "The art of multiprocessor programming"[1] is (paraphrased) as follows:
Two threads, A and B, want to access some memory. Each thread has a flag.
When thread A wants to access the shared memory:
When thread B wants to access the shared memory: Obviously this isn't a general purpose solution, but rather an easy to understand example demonstrating that atomic operations are not required.[1] http://www.amazon.com/Art-Multiprocessor-Programming-Maurice...