You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

The following blocking operations are virtual thread friendly in the current prototype; these methods do not pin the carrier thread when the operation blocks.

APIBlocking MethodsNotes
java.net.Socketconnect, read, write
java.net.ServerSocketaccept
java.net.DatagramSocket/MulticastSocketreceive



java.nio.channels.SocketChannelconnect, read, writesocket adaptor connect, read, and write also okay
java.nio.channels.ServerSocketChannelacceptsocket adaptor accept also okay
java.nio.channels.DatagramChannelread, receive

socket adaptor receive also okay

java.nio.channels.Pipe.SourceChannelread
java.nio.channels.Pipe.SinkChannelwrite
java.net.InetAddressgetByName, 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 in the sandbox (aefimov-dns-client-branch) that will be virtual thread friendly.


The following blocking operations are not currently virtual thread friendly; these methods pin the carrier thread when the operation blocks.

APIMethodsNotes
java.nio.channels.SelectorselectSelection operations are specified to synchronize on the selector and the selected-key set. May not be a concern as code using fibers should not need to use non-blocking I/O and Selectors.
  • No labels