The following blocking operations are virtual thread friendly; these methods do not pin the carrier thread when the operation blocks.
API | Methods | Notes |
---|---|---|
java.net.Socket | connect, read, write | |
java.net.ServerSocket | accept | |
java.net.DatagramSocket/MulticastSocket | receive | |
java.nio.channels.SocketChannel | connect, read, write | socket adaptor connect, read, and write also okay |
java.nio.channels.ServerSocketChannel | accept | socket adaptor accept also okay |
java.nio.channels.DatagramChannel | read, receive | socket adaptor receive also okay |
java.nio.channels.Pipe.SourceChannel | read | |
java.nio.channels.Pipe.SinkChannel | write |
The following blocking use the ForkJoinPool.ManagedBocker mechanism to temporarily extend parallelism until the blocking operation completes.
API | Methods |
---|---|
java.io.File | All file I/O operations |
java.io.FileInputStream | open, read, skip |
java.io.FileOutputStream | open, write |
java.io.RandomAccessFile | open, read, write, seek |
java.io.Console | All read, format and PrintStream operations |
java.net.InetAddress | All lookup operations |
java.nio.MappedByteBuffer | force |
java.nio.channels.Selector | All blocking selection operations |
java.nio.channels.FileChannel | read, write, lock, truncate, force, transferTo |
java.nio.file | All file I/O operations |
java.lang.Process | input/output/error streams |
Overview
Content Tools
ThemeBuilder