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

Compare with Current View Page History

« Previous Version 16 Next »

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

APIMethodsNotes
java.net.Socketconnect, read, writeRelies on JEP 353
java.net.ServerSocketaccept



java.nio.channels.SocketChannelconnect, read, writeconnect, read, and write on the socket adaptor obtained via SocketChannel::socket also okay
java.nio.channels.ServerSocketChannelacceptaccept on the socket adaptor obtained via ServerSocketChannel::socket also okay
java.nio.channels.DatagramChannelread, receivewrite and send do not block
java.nio.channels.Pipe.SourceChannelread
java.nio.channels.Pipe.SinkChannelwrite


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

APIMethodsNotes
java.net.DatagramSocketreceiveNeed to investigate if receive can be done without synchronizing on the DatagramPacket (unspecified but long standing behavior)
java.net.InetAddress

getByName, getAllByName, ..

These methods block in NSS/equivalent. Several operations to explore including using a thread pool or dusting off the JNDI DNS provider.
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