Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation | Date | Fri, 16 Dec 2005 15:24:42 +0000 |
| |
linux@horizon.com wrote:
> > Can be turned into: > > > > 1,C,A x = LL() > > 1,C,A x |= 2; > > 1,C,A SC(3) [success] > > 3,C,A ... > > ... which can be turned back into > > 1,C,A x = load() > 1,C,A x' = x | 2; > 1,C,A cmpxchg(x,x') [success] > 3,C,A ...
Which would be totally pointless.
If you have LL/SC, then the odds are you _don't_ have CMPXCHG, and that CMPXCHG is implemented using LL/SC, so what you end up with is:
1,C,A x = load() 1,C,A x' = x | 2; 1,C,A y = LL() 1,C,A if (y == x) 1,X,A SC(x'); 3,C,A ...
David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |