Subj : Re: posix and lock-free algorithms To : comp.programming.threads From : Joe Seigh Date : Thu Aug 11 2005 10:07 pm David Schwartz wrote: > "Joe Seigh" wrote in message > news:ysednZ2dnZ2L6h6gnZ2dnWFYZt-dnZ2dRVn-yZ2dnZ0@comcast.com... > >>David Schwartz wrote: >> >>>"Alexander Terekhov" wrote in message >>>news:42FB7410.5FD8C256@web.de... > > >>> No, it can't. The POSIX lock/unlock functions are defined as >>>synchronizing memory. If this means anything at all, it means >>>loads/stores can't be reordered across those functions. > > >>"synchronizing memory" is left undefined. > > > So what? > > >> I don't think you can supply your >>own arbitrary definition. Unless of course if you are a Posix implementer >>and then spontaneous comprehension of the true meaning of Posix will >>happen >>which by official Posix definition will be whatever thoughts are floating >>around your head at the time. > > > It's at least a full memory barrier that memory operations can't be > reordered around. Nothing else can be said to "synchronize memory" without > lots of caveats. > > Your argument is essentially that because it's not perfect it says > nothing. I reject that. > You're reading into "synchronize memory" more than may really be there. Nobody is saying it doesn't have some sort of effect. It's just not clear what that effect is and how it manifests itself. I notice there is tendency for some people to define semantics in terms of some arbitrary implementation and confusing one with the other. So for example, if the only way you knew of to implement a lock was with memory barriers then you might think that locks are defined as having memory barriers. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .