On Thu, 9 Jan 2025 10:13:52 GMT, Viktor Klang <vkl...@openjdk.org> wrote:

> The following patch updates Gatherers.mapConcurrent to limit work-in-progress 
> (on-going and completed-unpushed) to the `maxConcurrency` so that 
> head-of-line blocking does not cause completed-unpushed work to grow 
> unbounded.
> 
> This also simplifies interruption handling to ignore-and-restore, which needs 
> to be done on a per-element-basis as the calling thread can change between 
> invocations of the integrator, as well as the finisher, so restoring it on 
> finish is not possible (and won't happen if there's an exception thrown 
> during integration anyway).
> 
> Furthermore, logic has been added to reduce the risk of any spawned virtual 
> threads surviving the processing of the stream.

This pull request has now been integrated.

Changeset: 450636ae
Author:    Viktor Klang <vkl...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/450636ae28b84ded083b6861c6cba85fbf87e16e
Stats:     148 lines in 2 files changed: 93 ins; 16 del; 39 mod

8347274: Gatherers.mapConcurrent exhibits undesired behavior under variable 
delays, interruption, and finishing

Reviewed-by: alanb

-------------

PR: https://git.openjdk.org/jdk/pull/22999

Reply via email to