Re: CompletableFuture#postComplete() can be invoked concurrently?
Alex Otenko via Concurrency-interest <[email protected]> Sun, 23 Aug 2020 08:09:22 +0100
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CANkgWKgUoGKBvoygWCadkysEAN_56dWn5R_LeiFVxEqF=xW4bg@mail.gmail.com> |
Besides, first need to show reachability of that state. So you have src.result set. Concurrent invocations of d.completeThrowable vs d.completeValue are possible only if two threads can see different src.result or different src.result.ex. I don't see a path to reach this necessary condition. Alex On Sun, 23 Aug 2020, 08:03 Martin Buchholz, <[email protected]> wrote: > * Method postComplete is called upon completion unless the target > * is guaranteed not to be observable (i.e., not yet returned or > * linked). Multiple threads can call postComplete, which > > On Sat, Aug 22, 2020 at 11:53 PM Liu <[email protected]> wrote: > > > > In my first post, There is the special thread execution order. > > > > high level outcome is: > > two thread will invoke CompletableFuture#postComplete() > > on same object concurrently. > > > > expected outcome: > > only one thread can invoke CompletableFuture#postComplete() > > on a object. > > > > like I said, in CompletableFuture.UniApply#tryFire(), > > d.completeThrowable(x, r); and dep = null; > > are not a atomic operation. The gap between two codes > > may cause high level outcome. > > > > PS:when dep == null, it means current Completion Object > > has been done. > > > > PPS: CompletableFuture#postComplete() seems not design to be > > invoked on same object. > > > > > _______________________________________________ Concurrency-interest mailing list [email protected] http://cs.oswego.edu/mailman/listinfo/concurrency-interest