|
Re: Is enq(Node node) safe?: msg#00013java.jsr.166-concurrency
Hu, Jinsong wrote: My original posting does not assume that both threads need to successfully No. compareAndSetHead(h) expands to a compareAndSet(null, h). Only the first thread can succeed in CAS'ing head to non-null. The other might spin for a while until the successful one wakes up, but since this is a race in one-time initialization code, the potential for an unbounded spin is not worth specially handling. (Preliminary versions of this class had some spin control here, but in testing even on big multiprocessors, it was found not to have any effect so was simplified away.) -Doug
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Is enq(Node node) safe?, Hu, Jinsong |
|---|---|
| Next by Date: | RE: Is enq(Node node) safe?, Hu, Jinsong |
| Previous by Thread: | RE: Is enq(Node node) safe?, Hu, Jinsong |
| Next by Thread: | RE: Is enq(Node node) safe?, Hu, Jinsong |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |