lkml.org 
[lkml]   [2005]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
Date
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/

\
 
 \ /
  Last update: 2005-12-16 16:28    [W:0.572 / U:1.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site