Skip to content

Conversation

graalvmbot
Copy link
Collaborator

Since we already execute all calls to
NativeImageClassLoaderSupport.LoadClassHandler#handleClassFileName
via the ForkJoinPool.commonPool(), the use of parallelStream() here
does not further increase parallel execution and can be replaced
with a simple forEach without increasing class initialization time.

Additionally, avoiding parallelStream() fixes a deadlock that was
observable when only one CPU core is available (parallel streams
also use the commonPool() and this can lead to a deadlock with our
own use on single core systems).

Since we already execute all calls to
NativeImageClassLoaderSupport.LoadClassHandler#handleClassFileName
via the ForkJoinPool.commonPool(), the use of parallelStream() here
does not further increase parallel execution and can be replaced
with a simple forEach without increasing class initialization time.

Additionally, avoiding parallelStream() fixes a deadlock that was
observable when only one CPU core is available (parallel streams
also use the commonPool() and this can lead to a deadlock with our
own use on single core systems).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants