Re: Java Memory Model and ParallelStream

Doug Lea via Concurrency-interest <[email protected]>
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
Just to emphasize Alexey's main point...

On 3/6/20 6:44 AM, Aleksey Shipilev via Concurrency-interest wrote:

> Otherwise, look, high-level guarantees are the king.
> 
> It is not really relevant how that detection/acquisition happens:
>  - successful Thread.join() for a terminating worker; (guaranteed by JLS)
>  - successful Future.get() from executor; (guaranteed by package spec in java.util.concurrent.*)
>  - successful forEach for a parallel stream; (provided by extension?)

(See also the java.util.stream package docs. Current version at:
https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/stream/package-summary.html

In other words, java.util.concurrent components make strong enough
guarantees that almost nobody ever needs to think about them. On the
other hand, they so often invisibly do what people expect that is too
easy for some to imagine other nonexistent rules are responsible.

-Doug

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.