...
API | Blocking 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 operations pin the carrier thread when the operation blocks although they do use the ForkJoinPool.ManagedBocker mechanism to extended the parallelism temporarily when using the default scheduler.
API | Methods | Notes |
---|---|---|
java.net.InetAddress | getByName, getAllByName, .. | These methods currently off load name/address resolution to a background thread pool where threads block in the underlying NSS/equivalent. An alternative name service implementation for InetAddress is being developed has been prototyped in the sandbox (aefimov-dns-client-branch) that will be is virtual thread friendly. |
...
. TBD if this will be proposed as a JEP. Minimallhy a service provider interface will be introduced to make it possible to deploy name service implementations that do not pin the carrier thread |
...
during lookups. | ||
API | Methods | Notes |
---|---|---|
java.nio.channels.Selector | select | Selection operations are specified to synchronize on the selector and the selected-key set. May not be a concern as code using fibers virtual thread should not need to use non-blocking I/O and Selectors. The number of Selectors is typically small anyway. |