jdk.org
Subject: Re: [External] : Re: Question about mapConcurrent() Behavior and
Happens-Before Guarantees
Thanks for pressing on that, Viktor!
I think I was fooled by my quick-and-dirty test. As I tried to harden it, I
failed to deduce consistent behavior about what parallel stream does when
Tuesday, 8 July 2025 04:26
> *To:* Viktor Klang
> *Cc:* core-libs-dev@openjdk.org
> *Subject:* [External] : Re: Question about mapConcurrent() Behavior and
> Happens-Before Guarantees
>
> Thanks for the quick reply, Viktor!
>
> On Mon, Jul 7, 2025 at 2:35 AM Viktor Klang
>
ore-libs-dev@openjdk.org
Subject: [External] : Re: Question about mapConcurrent() Behavior and
Happens-Before Guarantees
Thanks for the quick reply, Viktor!
On Mon, Jul 7, 2025 at 2:35 AM Viktor Klang
mailto:viktor.kl...@oracle.com>> wrote:
Hi Jige,
>Initially, I thought this design choice m
Thanks for the quick reply, Viktor!
On Mon, Jul 7, 2025 at 2:35 AM Viktor Klang wrote:
> Hi Jige,
>
> >Initially, I thought this design choice might provide a strong
> happens-before guarantee. My assumption was that an application catching a
> RuntimeException would be able to *observe all side
Hi Jige,
>Initially, I thought this design choice might provide a strong happens-before
>guarantee. My assumption was that an application catching a RuntimeException
>would be able to observe all side effects from the virtual threads, even
>though this practice is generally discouraged. This se
Assuming the test code and my reading of the mapConcurrent() code haven't
misled me, I think this observation suggests that if an *upstream exception*
terminates the stream, mapConcurrent() may not be able to properly cancel
or interrupt the virtual threads it has already started. This could
potent
Yes.
I got two tests that show the behavior difference between downstream
exception and upstream exception:
@Test public void mapConcurrently_upstreamFailureDoesNotInterrupt() {
ConcurrentLinkedQueue started = new ConcurrentLinkedQueue<>();
ConcurrentLinkedQueue interrupted = new ConcurrentLin
These questions necessitate runnable examples. Do you have any
On Thu, Jul 3, 2025, 10:37 AM Jige Yu wrote:
> Hi JDK Core Devs,
>
> I'm writing to you today with a question about the behavior of
> mapConcurrent() and its interaction with unchecked exceptions. I've been
> experimenting with the A