...
API | Method(s) | Notes |
---|---|---|
java.lang.Thread | sleep, join | join to wait for a virtual thread to terminate |
java.lang.Process | waitFor | Linux/macOS only |
java.util.concurrent | All blocking operations | |
java.net.Socket | connect, read, write | Socket constructors with a host name parameter may need to do a lookup with InetAddress, see below |
java.net.ServerSocket | accept | |
java.net.DatagramSocket/MulticastSocket | receive | connect, disconnect and send do not block |
java.nio.channels.SocketChannel | connect, read, write | |
java.nio.channels.ServerSocketChannel | accept | |
java.nio.channels.DatagramChannel | read, receive | connect, disconnect, send, and write do not block |
java.nio.channels.Pipe.SourceChannel | read | |
java.nio.channels.Pipe.SinkChannel | write | |
Console streams (System.in, out, err) | read, write, printf | Linux/macOS only at this time. |
The following blocking operations use the ForkJoinPool.ManagedBocker mechanism when invoked from a virtual thread. Parallelism is temporarily extended until the blocking operation completes.
API | Method(s) | Notes |
---|---|---|
java.lang.Object | wait | |
java.lang.Process | waitFor | Windows only |
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.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 |
The following are some of blocking operations use the ForkJoinPool.ManagedBocker mechanism by way of operations in the previous table.
...
Overview
Content Tools
ThemeBuilder