Virtual Thread - 導入の背景と、効果的な使い方 -

Virtual Thread - 導入の背景と、効果的な使い方 -

2023.01.21 ブリ会議 発表資料

Yuichi.Sakuraba

January 21, 2023

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

25 slides
  1. - -

  2. public class ThreadPoolExecutor extends AbstractExecutorService { ... private final class

    Worker extends AbstractQueuedSynchronizer implements Runnable { Worker(Runnable firstTask) { setState(-1); this.firstTask = firstTask; this.thread = getThreadFactory().newThread(this); } ...
  3. int blockingRead(byte[] b, int off, int len, long nanos) throws

    IOException { ... // read, no timeout configureSocketNonBlockingIfVirtualThread(); n = tryRead(b, off, len); while (IOStatus.okayToRetry(n) && isOpen()) { park(Net.POLLIN); n = tryRead(b, off, len); } ...
  4. - -

More Decks by Yuichi.Sakuraba

Other Decks in Technology