<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
For non-CPU-bound workloads using ForkJoinPool, my own personal experience is that setting the parallelism to around a factor of 0.7-0.8x the number of physical cores tends to provide a decent starting point for tuning.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature" style="color: inherit;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,<br>
–</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b><br>
</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>Viktor Klang</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Software Architect, Java Platform Group<br>
Oracle</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> loom-dev <loom-dev-retn@openjdk.org> on behalf of Alan Bateman <alan.bateman@oracle.com><br>
<b>Sent:</b> Wednesday, 14 August 2024 21:16<br>
<b>To:</b> Robert Engels <robaho@icloud.com><br>
<b>Cc:</b> loom-dev <loom-dev@openjdk.org><br>
<b>Subject:</b> Re: Loom and high performance networking</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 14/08/2024 16:47, Robert Engels wrote:<br>
> :<br>
><br>
> Which leads me to the question does Java need a better (or dynamic) <br>
> way of determining the optimum parallelism based on load? It seems the <br>
> only way to set the parallelism is at startup, and it is constant.<br>
><br>
VirtualThreadSchedulerMXBean provides a monitoring and management <br>
interface to the virtual thread scheduler. It exposes the current <br>
parallelism and allows it be changed. There are also methods to get the <br>
thread count, and estimates for the current number of carriers and <br>
number of virtual threads queued to execute. It may potentially be used <br>
to dynamically adjust parallelism but nothing is using it at this time.<br>
<br>
-Alan<br>
</div>
</span></font></div>
</body>
</html>