Re: Why SynchronousQueue.TransferQueue#clean() not clean the last node
Alex Otenko via Concurrency-interest <[email protected]> Mon, 17 Aug 2020 07:17:52 +0100
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CANkgWKgrkn2Eac9Q3W-W5MLizgYQmiKYwgo5Kc0kLD0XDaiZAw@mail.gmail.com> |
Correct. In addition, notice that updating tail to point to B can't be done atomically with unlinking of C. Then it's possible for head and tail to point to chains with no common nodes. Alex On Mon, 17 Aug 2020, 03:14 Liu, <[email protected]> wrote: > > I try to understand what you guys are saying. > > Firstly, A -> B -> C(tail) -> null, and if C should be cleaned, > it should become A -> B(tail) -> null. but there is No such atomic > operation. > > Secondly, some threads may see A -> B -> null and C(tail), and may append > node > after C which is wrong. > > > > > > _______________________________________________ Concurrency-interest mailing list [email protected] http://cs.oswego.edu/mailman/listinfo/concurrency-interest