Slide 26
Slide 26 text
Platform Thread Platform Thread
......
Virtual Thread
Task
public int read(ByteBuffer buf) throws IOException {
...
readLock.lock();
try {
...
configureSocketNonBlockingIfVirtualThread();
n = IOUtil.read(fd, buf, -1, nd);
if (blocking) {
while (IOStatus.okayToRetry(n) && isOpen()) {
park(Net.POLLIN);
n = IOUtil.read(fd, buf, -1, nd);
}
}
...
sun.nio.ch.SocketChannelImpl
例