From b8c5c740477d84fe6e23e7fc5ebb21bb3c1c1fe5 Mon Sep 17 00:00:00 2001 From: JunQiu Date: Sat, 14 Oct 2023 16:41:05 +0800 Subject: [PATCH] =?UTF-8?q?[docs=20update]=20=E6=96=B0=E5=A2=9E=20Java=202?= =?UTF-8?q?1=20=E8=99=9A=E6=8B=9F=E7=BA=BF=E7=A8=8B=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../virtual-thread.png | Bin 0 -> 31797 bytes .../java-concurrent-questions-01.md | 202 ++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 docs/java/concurrent/images/java-concurrent-questions-01/virtual-thread.png diff --git a/docs/java/concurrent/images/java-concurrent-questions-01/virtual-thread.png b/docs/java/concurrent/images/java-concurrent-questions-01/virtual-thread.png new file mode 100644 index 0000000000000000000000000000000000000000..59ce01ae7168044818fada322a50846a3fff1430 GIT binary patch literal 31797 zcmeFZcT|&G*Ds2)757%b4ob75B1Awz2qY?sU;zQ8LzF5~A|Sy)iVBKK6X_sCML?tp zkq$v=5fT!lh0vlxh>$>p5JCtE=V5R6`+noz`^UNCoHOqC-EU`%j67vMbCqYVIe+uF z=E{>R=I1y5vFi^hDXEQSrf03Bq@=-8Qmdb@TMJy_Uu>xdepUrpoj)U0Oi`KuPJZ(` zefhMMRB7D$r5kI2^WSfq+6PHVZJJ#9u6oe@N2-)mSi9NT(^v1hOx3eX{7Ck=>eCf1 z=f0~acRfjj-b3x*fqM|tWtI2vH?{lCANDS63odLP&a~O*VDr7nGwL@;#GSFN`=0qq z)6Hde9cbRWHon;@Zk1}w$^H93mu^)0u{9_j{JZJ?d!BKXnr?O1_{xN=ji9S@zF^4ZnNJ{CV)`H@x(p2gVQRf0nto=M(48 z3m>0dNBntk-SikR5Wwfy{#4~Z4-~fiBj%s6`CrtV^q*l3g0OW{R&YD?skgaV?+4

ne^SBEE&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pMuzgb$ht! z;D)cdISrxUjEAD4lMnhpJ39X0a~U~AZ+$Q6{}LM5fyxAo7d$>llL_Dk$r>tXLmMm z+nB7|}7`B%D;p{jT==t-OIIK{5-~IWxfylgz?FogWyc0 zB@(yCh5&=r$O$;B0WU&|K@O1!A!jl3%OdB!`$AF)=K@ctW>Ld>qr)hkW} zj$vi*b&B+H8|{g!M?#UJPWt3X+NsHwVRY=l0Ofy;4^CoN9v-rKx#Mu6)5+*;Zbp1B zT$*DgE&&;K6|>lT!xlfk7OuNLm1ef6E{YAGHU7CzyBxL9RcSW781=rv5fE%&)kYz^ z1sX|Ei>%J_S%j>kV3u35PE%YPd2>jP|lGB<#Cm@(~4Q9eYQ(^n8`YXu!&8ZdSsXyr~q=S1Z9{Mr!NRq zZ(9T8LghHfazqsQQCxdTDjQ?i$&LL+7;MyFWZ7!rO{Ol|F1ru;9vpI#zk zK8q># zW(dr|=FsU(0)`Z>b$un9lRI{7ifWdS#ucV|gt`Oc(9KhLgiC`Wu3qh`+w%UqUV}p- z$A0{Gd9oZB3K~skHih4OnuuZiRU{VDd;Yg@(e#~Xr@v1eXAJ9fEQpdwPE8g8F7y_ z;sAUq<4eBi)KstK&I5ywlzgs+a<{q`;Y}#rW(51#)ObQXkz2pnyffL^o+#atBJJBf zHIuhAnMhOLi0fOK*sM}9Kqn?9O~cEd8-7ac8UJ}q?K;Q-iTfZL@L^P(ueWaeUC$T7_8K~q&s!qz zjhiithq(z{bemS`P-=ZVX!V?i@EF2lKH8qHLOyG9yEXpxhS$DyOIxZ(vQue_<=S`n z09JeY_O>}rYVx+zif0@NR+@fobYqh_JA)J6ef%13lD!Ue(2>3>w$wV7-fWhe^{Paj z#<~Dd_3Y@$eQ0{;xV^mEA>9R+^+O_y-+wg-S$` list = new ArrayList<>(); + public static void main(String[] args) { + // 开启线程 统计平台线程数 + ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1); + scheduledExecutorService.scheduleAtFixedRate(() -> { + ThreadMXBean threadBean = ManagementFactory.getThreadMXBean(); + ThreadInfo[] threadInfo = threadBean.dumpAllThreads(false, false); + updateMaxThreadNum(threadInfo.length); + }, 10, 10, TimeUnit.MILLISECONDS); + + long start = System.currentTimeMillis(); + // 虚拟线程 + ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor(); + // 使用平台线程 + // ExecutorService executor = Executors.newFixedThreadPool(200); + for (int i = 0; i < 10000; i++) { + executor.submit(() -> { + try { + // 线程睡眠 0.5 s,模拟业务处理 + TimeUnit.MILLISECONDS.sleep(500); + } catch (InterruptedException ignored) { + } + }); + } + executor.close(); + System.out.println("max:" + list.get(0) + " platform thread/os thread"); + System.out.printf("totalMillis:%dms\n", System.currentTimeMillis() - start); + + + } + // 更新创建的平台最大线程数 + private static void updateMaxThreadNum(int num) { + if (list.isEmpty()) { + list.add(num); + } else { + Integer integer = list.get(0); + if (num > integer) { + list.add(0, num); + } + } + } +} +``` + +#### 请求数10000 单请求耗时 1s + +```plain +// Virtual Thread +max:22 platform thread/os thread +totalMillis:1806ms + +// Platform Thread 线程数200 +max:209 platform thread/os thread +totalMillis:50578ms + +// Platform Thread 线程数500 +max:509 platform thread/os thread +totalMillis:20254ms + +// Platform Thread 线程数1000 +max:1009 platform thread/os thread +totalMillis:10214ms + +// Platform Thread 线程数2000 +max:2009 platform thread/os thread +totalMillis:5358ms +``` + +#### 请求数10000 单请求耗时 0.5s +```plain +// Virtual Thread +max:22 platform thread/os thread +totalMillis:1316ms + +// Platform Thread 线程数200 +max:209 platform thread/os thread +totalMillis:25619ms + +// Platform Thread 线程数500 +max:509 platform thread/os thread +totalMillis:10277ms + +// Platform Thread 线程数1000 +max:1009 platform thread/os thread +totalMillis:5197ms + +// Platform Thread 线程数2000 +max:2009 platform thread/os thread +totalMillis:2865ms +``` + +- 可以看到在密集 IO 的场景下,需要创建大量的平台线程异步处理才能达到虚拟线程的处理速度。 +- 因此,在密集 IO 的场景,虚拟线程可以大幅提高线程的执行效率,减少线程资源的创建以及上下文切换。 +- 吐槽:虽然虚拟线程我很想用,但是我 Java8 有机会升级到 Java21 吗?呜呜 + +``` +注:有段时间 JDK 一直致力于 Reactor 响应式编程来提高Java性能,但响应式编程难以理解、调试、使用,最终又回到了同步编程,最终虚拟线程诞生。 +``` + \ No newline at end of file