Re: CompletableFuture#postComplete() can be invoked concurrently?

Liu via Concurrency-interest <[email protected]> Sun, 23 Aug 2020 14:53:22 +0800 (GMT+08:00)
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
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