• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Loom
  4. Networking IO

Networking IO

  • Created by Alan Bateman, last modified on Apr 26, 2019

The following blocking operations are fiber friendly, meaning the fiber will park without pinning the carrier thread when the operation blocks.

APIMethodsNotes
java.net.Socketread, write, closeRelies on JEP 353
java.net.ServerSocketaccept, close



java.nio.channels.SocketChannelread, write, closeread, write, and close on the socket adaptor obtained via SocketChannel::socket also okay
java.nio.channels.ServerSocketChannelaccept, closeaccept and close on the socket adpator obtained via ServerSocketChannel::socket also okay
java.nio.channels.DatagramChannelread, receive, closewrite/send do not block
java.nio.channels.Pipe.SourceChannelread, close
java.nio.channels.Pipe.SinkChannelwrite, close


The following blocking operations are not yet fiber friendly; these methods may pin the carrier thread when the socket is not ready for I/O.

APIMethodsNotes
java.net.DatagramSocketreceiveNeed to investigate if receive can be done without synchronizing on the DatagramPacket (unspecified but long standing behavior)
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.
java.lang.ThreadinterruptIf a thread is blocked in an I/O operation on an InterruptibleChannel then the channel is closed. The locking to support this is not yet fiber friendly so Thread.interrupt may pin the carrier thread while waiting for the blocking operations on the channel to abort.
Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 296, "requestCorrelationId": "7c1947ddafd4121c"}