<div class="__aliyun_email_body_block"><div style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun"><div style="clear: both;">All tasks are submitted by the platform thread (main). </div><div style="clear: both;">```</div><div style="clear: both; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Consolas, 'Courier New', monospace; font-weight: 400; font-size: 14px; line-height: 19px; white-space: pre;"><div ><span style="color: rgb(38, 127, 153);">ThreadFactory</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">factory</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(38, 127, 153);">Thread</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">ofVirtual</span><span style="color: rgb(0, 0, 0);">().</span><span style="color: rgb(121, 94, 38);">factory</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(38, 127, 153);">ExecutorService</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">es</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(38, 127, 153);">Executors</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">newThreadPerTaskExecutor</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 16, 128);">factory</span><span style="color: rgb(0, 0, 0);">);</span></div><div ><span style="color: rgb(175, 0, 219);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(38, 127, 153);">int</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(9, 134, 88);">0</span><span style="color: rgb(0, 0, 0);"> ; </span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);"> < </span><span style="color: rgb(9, 134, 88);">5000</span><span style="color: rgb(0, 0, 0);">; </span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);">++) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">System</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 112, 193);">out</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">println</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(163, 21, 21);">"execute: "</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);">);</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">es</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">execute</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(175, 0, 219);">new</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(121, 94, 38);">Task</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);">));</span></div><br ><div ><span style="color: rgb(0, 0, 0);">}</span></div><div ><span style="color: rgb(0, 0, 0);"> </span></div><div ><span style="color: rgb(0, 16, 128);">es</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">shutdown</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(175, 0, 219);">try</span><span style="color: rgb(0, 0, 0);"> {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(175, 0, 219);">while</span><span style="color: rgb(0, 0, 0);">(!</span><span style="color: rgb(0, 16, 128);">es</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">awaitTermination</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(9, 134, 88);">10</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(38, 127, 153);">TimeUnit</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 112, 193);">SECONDS</span><span style="color: rgb(0, 0, 0);">)) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">System</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 112, 193);">out</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">println</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(163, 21, 21);">"still waiting..."</span><span style="color: rgb(0, 0, 0);">);</span></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div><div ><span style="color: rgb(0, 0, 0);">} </span><span style="color: rgb(175, 0, 219);">catch</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(38, 127, 153);">Exception</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">e</span><span style="color: rgb(0, 0, 0);">) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">e</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">printStackTrace</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(0, 0, 0);">}</span></div><div ><span style="color: rgb(0, 0, 0);"><br ></span></div><div ><span style="color: rgb(0, 0, 0);"><span class="aym_bookmark" id="_aym_bookmark_sqm_71" style="display:none"></span></span><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Consolas, 'Courier New', monospace; font-weight: 400; font-size: 14px; line-height: 19px; white-space: pre;"><div ><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">Task</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">Runnable</span><span style="color: rgb(0, 0, 0);"> {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">long</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">start</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 16, 128);">run_start</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 16, 128);">end</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">int</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">num</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(121, 94, 38);">Task</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(38, 127, 153);">int</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);">) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">start</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(38, 127, 153);">System</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">nanoTime</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">num</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(0, 16, 128);">i</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div><div ><span style="color: rgb(0, 0, 0);"> </span></div><div ><span style="color: rgb(0, 0, 0);"> @</span><span style="color: rgb(38, 127, 153);">Override</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">void</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(121, 94, 38);">run</span><span style="color: rgb(0, 0, 0);">() {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">run_start</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(38, 127, 153);">System</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">nanoTime</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">Integer</span><span style="color: rgb(0, 0, 0);">[] </span><span style="color: rgb(0, 16, 128);">largeInt</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(175, 0, 219);">new</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">Integer</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(9, 134, 88);">100</span><span style="color: rgb(0, 0, 0);">];</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(175, 0, 219);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(38, 127, 153);">int</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(9, 134, 88);">0</span><span style="color: rgb(0, 0, 0);"> ; </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);"> < </span><span style="color: rgb(0, 16, 128);">largeInt</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 112, 193);">length</span><span style="color: rgb(0, 0, 0);">; </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);">++) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">largeInt</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);">] = </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);"> * </span><span style="color: rgb(9, 134, 88);">100</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(175, 0, 219);">try</span><span style="color: rgb(0, 0, 0);"> {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">Thread</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">sleep</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(9, 134, 88);">100</span><span style="color: rgb(0, 0, 0);">); </span><span style="color: rgb(0, 128, 0);">// yield this vthread</span></div><div ><span style="color: rgb(0, 0, 0);"> } </span><span style="color: rgb(175, 0, 219);">catch</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(38, 127, 153);">Exception</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">e</span><span style="color: rgb(0, 0, 0);">) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">e</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">printStackTrace</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">int</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">sum</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(9, 134, 88);">0</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(175, 0, 219);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(38, 127, 153);">int</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(9, 134, 88);">0</span><span style="color: rgb(0, 0, 0);"> ; </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);"> < </span><span style="color: rgb(0, 16, 128);">largeInt</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 112, 193);">length</span><span style="color: rgb(0, 0, 0);">; </span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);">++) {</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">sum</span><span style="color: rgb(0, 0, 0);"> += </span><span style="color: rgb(0, 16, 128);">largeInt</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 16, 128);">j</span><span style="color: rgb(0, 0, 0);">];</span></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">end</span><span style="color: rgb(0, 0, 0);"> = </span><span style="color: rgb(38, 127, 153);">System</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">nanoTime</span><span style="color: rgb(0, 0, 0);">();</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">double</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">passTime</span><span style="color: rgb(0, 0, 0);"> = (</span><span style="color: rgb(0, 16, 128);">end</span><span style="color: rgb(0, 0, 0);"> - </span><span style="color: rgb(0, 16, 128);">run_start</span><span style="color: rgb(0, 0, 0);">)/</span><span style="color: rgb(9, 134, 88);">1000000.0</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">double</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">waitRunTime</span><span style="color: rgb(0, 0, 0);"> = (</span><span style="color: rgb(0, 16, 128);">run_start</span><span style="color: rgb(0, 0, 0);"> - </span><span style="color: rgb(0, 16, 128);">start</span><span style="color: rgb(0, 0, 0);">)/</span><span style="color: rgb(9, 134, 88);">1000000.0</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">double</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 16, 128);">totalTime</span><span style="color: rgb(0, 0, 0);"> = (</span><span style="color: rgb(0, 16, 128);">end</span><span style="color: rgb(0, 0, 0);"> - </span><span style="color: rgb(0, 16, 128);">start</span><span style="color: rgb(0, 0, 0);">)/</span><span style="color: rgb(9, 134, 88);">1000000.0</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">System</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 112, 193);">out</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">println</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(38, 127, 153);">Thread</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(121, 94, 38);">currentThread</span><span style="color: rgb(0, 0, 0);">() + </span><span style="color: rgb(163, 21, 21);">"</span><span style="color: rgb(238, 0, 0);">\t</span><span style="color: rgb(163, 21, 21);">"</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(0, 16, 128);">num</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(163, 21, 21);">"-calc-result:"</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(0, 16, 128);">sum</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(163, 21, 21);">"</span><span style="color: rgb(238, 0, 0);">\t</span><span style="color: rgb(163, 21, 21);">run(ms): "</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(0, 16, 128);">passTime</span><span style="color: rgb(0, 0, 0);">+ </span><span style="color: rgb(163, 21, 21);">"</span><span style="color: rgb(238, 0, 0);">\t</span><span style="color: rgb(163, 21, 21);">wait-run(ms): "</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(0, 16, 128);">waitRunTime</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(163, 21, 21);">"</span><span style="color: rgb(238, 0, 0);">\t</span><span style="color: rgb(163, 21, 21);">total(ms): "</span><span style="color: rgb(0, 0, 0);"> + </span><span style="color: rgb(0, 16, 128);">totalTime</span><span style="color: rgb(0, 0, 0);">);</span></div><div ><span style="color: rgb(0, 0, 0);"><br ></span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">TestFJPParam</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 16, 128);">vtTimes</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 16, 128);">num</span><span style="color: rgb(0, 0, 0);">] = </span><span style="color: rgb(0, 16, 128);">passTime</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">TestFJPParam</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 16, 128);">vtWaitTimes</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 16, 128);">num</span><span style="color: rgb(0, 0, 0);">] = </span><span style="color: rgb(0, 16, 128);">waitRunTime</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(38, 127, 153);">TestFJPParam</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 16, 128);">vtWholeTimes</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 16, 128);">num</span><span style="color: rgb(0, 0, 0);">] = </span><span style="color: rgb(0, 16, 128);">totalTime</span><span style="color: rgb(0, 0, 0);">;</span></div><div ><br ></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div><div ><span style="color: rgb(0, 0, 0);"> }</span></div></div><div ><span class="aym_bookmark" id="_aym_bookmark_sqm_72" style="display:none"></span></div><span style="color: rgb(0, 0, 0);"><br ></span></div></div><div style="clear: both;">```</div><div style="clear: both;"><br ></div><div style="clear: both;">"<span style="color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; word-spacing: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;">ThreadPoolExecutor and SynchronousQueue" I mentioned before is not used in test. It just a idea. I<span >f we emulate this approach to add worker threads to complete tasks, would it be possible to reduce latency? </span></span></div><div style="clear: both;"><br ></div><blockquote style="margin-right: 0px; margin-top: 0px; margin-bottom: 0px; font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);"><div style="clear: both;">------------------------------------------------------------------</div><div style="clear: both;">发件人:Alan Bateman <alan.bateman@oracle.com></div><div style="clear: both;">发送时间:2025年2月20日(星期四) 18:27</div><div style="clear: both;">收件人:"唐佳未(佳未)"<tjw378335@alibaba-inc.com>; "loom-dev"<loom-dev@openjdk.org></div><div style="clear: both;">主 题:Re: re:remove corePoolSize in ForkJoinPool<init> and hope to improve FJP's algorithm</div><div style="clear: both;"><br ></div>On 20/02/2025 01:40, 唐佳未(佳未) wrote:<br >
<div >
<div style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">
<div style="clear: both;"><span style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">:<br >
</span></div>
<br >
<div style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">
<div style="clear: both;">
<div class=" __aliyun_node_has_color __aliyun_node_has_bgcolor" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Consolas, 'Courier New', monospace; font-weight: 400; font-size: 14px; line-height: 19px; white-space: pre;"><div ><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">7</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">3931</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">1426</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">
java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">5908</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">48</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]
</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">7731</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">236</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]</span></div><div ><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">java.util.concurrent.ForkJoinPool</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">@678ad349[Running, parallelism = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, size = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">8</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, active = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">2</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, running = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, steals = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">10370</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, tasks = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">, submissions = </span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 255);">0</span><span class=" __aliyun_node_has_color" style="color: rgb(0, 0, 0);">]</span></div></div>
</div>
</div>
</div>
</div>
Thanks for the jcmd output. It shows that there are no queued tasks
in the worker queues (tasks = 0) but many tasks are in the external
submission queues. Tasks for virtual threads are pushed to an
external submission queue when a virtual thread is initially
started, unparked by a platform thread, unblocked by another thread
exiting a monitor that the virtual thread was blocked on, or awoken
after sleep/timed-park.<br >
<br >
Your first mail speaks of a usage wth ThreadPoolExecutor and
SynchronousQueue so I will guess there is some hand off from a
platform thread to a virtual thread that would result in the task
for the virtual thread being pushed to an external queue.<br >
<br >
Can you tell us a bit about the "run function"? I can't tell from
the mails so far if this function is mostly compute bound or whether
these virtual threads are blocking regularly to allow carriers be
released to do other work. One of the mails mentions "tasks switched
out but I wasn't sure how to read that. Even without this then you
are correct that the scheduling is not fair.<br >
<br >
-Alan<br >
<br >
</blockquote></div></div>