Re: Why SynchronousQueue.TransferQueue#clean() not clean the last node
Alex Otenko via Concurrency-interest <[email protected]> Sat, 15 Aug 2020 07:22:46 +0100
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CANkgWKi+vWQyGbiEbyAmD3GAgL0F1025n0dYxS=KXGOxV0rnoQ@mail.gmail.com> |
Yes. There is an unspoken invariant that head and tail make progress in one direction. That is pretty much the only way to make sure the head never passes the tail. Then deleting tail cannot be done without moving the tail backwards to pred. This breaks the unspoken invariant in the presence of concurrent modifications of head. Alex On Sat, 15 Aug 2020, 07:18 Liu, <[email protected]> wrote: > Thanks. I just think about it, it is kind of difficult to keep the > correctness of tail. > _______________________________________________ Concurrency-interest mailing list [email protected] http://cs.oswego.edu/mailman/listinfo/concurrency-interest