IngramChen 積分 1

還要到 java 15 才能用, 等不及了

除了 low pause 外, 用不到的 heap 還可以還給 OS, 這簡直是為了 intellij ide 設計的啊

koji 積分 0

阿對齁,他必須得讓 ThreadLocal 在 virtual thread 中行為像之前一樣,了解了。

IngramChen 積分 1 編輯於

他是說以前一定要寫 finally 去回溯/移除 自己放在 ThreadLocal 的變數,因為 Thread 多半有 pool,是大家共用的。

之後用 virtual thread 就沒人在共用了,所以 ThreadLocal 不用怕碰到別人塞的值,也不用 finally 去處理。

而你講的 sharing 是該 thread 被用的當下,很多人都想塞變數,這個的確沒變,要靠 Scope Variable 的結構減少忘記互蓋的問題。

koji 積分 1 編輯於

比較在意 ThreadLocal 關聯的應用場景..

Scope Variables1

var oldValue = myTL.get();
myTL.set(newValue);
try {
  ...
} finally {
  myTL.set(oldValue);
}

Without this imposed structure, when a thread is shared among multiple tasks, one task’s TL values might leak into another. Virtual threads solve that problem by being lightweight enough to not require sharing.

沒看懂,為何 lightweight 就不用 sharing.

IngramChen 積分 0

6MB heap == 一百萬 virtual thread

sweet!

IngramChen 積分 0

對對,沒錯

jdbc 應該沒人會去開 thread

實例應該是從 tomcat 那層開始開 virtual thread 就好,app 通通不用動

koji 積分 1 編輯於
應該可以像這樣?
web request virtual thread->
      socket -> (virtually blocking)
      business logic ->
      jdbc request -> driver socket -> (virtually blocking)

除非是為了 structured concurrency,不然可以不用再自己看到一層 virtual thread?

等等來看看他的 EA 能不能玩

IngramChen 積分 0

Even basic control flow, like loops and try/catch, need to be reconstructed in “reactive” DSLs, some sporting classes with hundreds of methods.

RxJava 就是你

一個 class 有上百個 method 就是錯錯錯,沒什麼好說的

能夠寫正常的程式的話,誰要寫 reactive,誰要寫 async/await

Project Loom 走在正確的道路上,成功後就會換其他平台來學

IngramChen 積分 0

virtual thread 真是讓人興奮

所以 jdbc driver 都不用改自動就會變 virtual thread ?

  web request ->
      socket virtual thread -> (virtually blocking)
      business logic ->
      jdbc request ->
          driver socket virtual thread -> (virtually blocking)

然後在兩次的 virtual block 中,背後 OS thread 可能已經換過,或是沒變這樣?

IngramChen 積分 0

讓 gradle 去跑 terraform 到是沒見過

IngramChen 積分 0

為什麼apache 特別愛用神話的梗咧

IngramChen 積分 1

原來還沒實作啊, 我以為已經完成....

changyuheng 積分 1 編輯於

It's like putting another I/O specific cache layer that supports plenty operations including batch between the kernel space and the user space, so that the transitions between the kernel mode and the user mode can be largely reduced. Relying on a bunch of magic, it increases the throughput of I/O operations.

changyuheng 積分 1

最近發現 Kotlin 的設計商 JetBrains 自己有做了一個教學系統叫做 JetBrains Academy ,透過線上教學文件和自動審核程式的機制來讓你一步一步學習 Kotlin ,我覺得還蠻不錯的,只是每次 Submit 上去都要等蠻久的就是了 XD""""

目前支援 Java, Kotlin, Python 三種語言。

haocheng 積分 0

就看這次會不會一起調整囉…

IngramChen 積分 0

spring 版本的問題是不同模組的版號不一致

koji 積分 0

XD...真的得看很久... 搞 padding 跟 15後的變更還蠻有趣的,雖然寫應用層不太會去自己搞 padding。