lkml.org 
[lkml]   [2010]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: atomic RAM ?
> 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


\
 
 \ /
  Last update: 2010-04-09 15:13    [from the cache]
©2003-2011 Jasper Spaans