> Hi, I'm looking for some algorithm of mutex for n processes and I found
> only Lamport's Alg. There are at least 2 more algorithms: Peterson and
[quoted text clipped - 3 lines]
>
> greetings...
Before looking for more algorithms, I strongly recommend studying one,
such as Peterson's, in the light of the Java memory model.
I believe you are taking algorithms that were designed with various
memory model assumptions, and just assuming they will work in Java.
Some of what you are doing may even work on a uniprocessor, though not
necessarily guaranteed to do so.
Patricia