Re: [External] : Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-14 Thread Viktor Klang
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

Re: [External] : Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-12 Thread Jige Yu
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 >

Re: [External] : Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-08 Thread 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

Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-07 Thread Jige Yu
roup > Oracle > -- > *From:* core-libs-dev on behalf of Jige > Yu > *Sent:* Thursday, 3 July 2025 16:36 > *To:* core-libs-dev@openjdk.org > *Subject:* Question about mapConcurrent() Behavior and Happens-Before > Guarantees > > >

Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-07 Thread Viktor Klang
a Platform Group Oracle From: core-libs-dev on behalf of Jige Yu Sent: Thursday, 3 July 2025 16:36 To: core-libs-dev@openjdk.org Subject: Question about mapConcurrent() Behavior and Happens-Before Guarantees Hi JDK Core Devs, I'm writing to you tod

Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-04 Thread Jige Yu
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

Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-04 Thread Jige Yu
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

Re: Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-03 Thread David Alayachew
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

Question about mapConcurrent() Behavior and Happens-Before Guarantees

2025-07-03 Thread Jige Yu
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 API and observed that mapConcurrent() blocks and joins all virtual threads upon an unchecked exception before propagating