Re: CompletableFuture#postComplete() can be invoked concurrently?
Martin Buchholz via Concurrency-interest <[email protected]> Sun, 23 Aug 2020 00:03:00 -0700
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CA+kOe0_3sWwHZs=2PV92mOK1=hKgpoOYL1KQ-v8sR-apv=3qDA@mail.gmail.com> |
* 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