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
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

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

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

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