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

    Loading...
  1. Dashboard
  2. Loom
  3. Main
  4. This page on blocking operations can be removed.

Page History

Versions Compared

Old Version 25

changes.mady.by.user Alan Bateman

Saved on Jun 29, 2020

compared with

New Version 26

changes.mady.by.user Alan Bateman

Saved on Oct 23, 2020

  • Previous Change: Difference between versions 24 and 25
  • Next Change: Difference between versions 26 and 27
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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


The following blocking operations pin the carrier thread when the operation blocks. These blocking operations do use the uses the ForkJoinPool.ManagedBocker mechanism (in the case of default scheduler at least) to temporarily extend to temporarily expand the parallelism until the blocking operation completes.

Notes
APIMethods
java.io.FileAll file I/O operations
java.io.FileInputStreamopen, read, skip
java.io.FileOutputStreamopen, write
java.netio.InetAddressRandomAccessFilegetByNameopen, read, getAllByNamewrite, seek
java.io.An alternative name service implementation for InetAddress has been prototyped in the sandbox (aefimov-dns-client-branch) is virtual thread friendly. TBD if this will be proposed as a JEP. 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.ConsoleAll read, format and PrintStream operations


java.net.InetAddressAll lookup operations


java.nio.MappedByteBufferforce
java.nio.channels.SelectorAll blocking selection operations
java.nio.channels.SelectorFileChannelread, write, lock, truncate, force, transferTo
java.nio.fileAll file I/O operationsselectSelection operations are specified to synchronize on the selector and the selected-key set. May not be a concern as code using virtual thread should not need to use non-blocking I/O and Selectors. The number of Selectors is typically small anyway.
Overview
Content Tools
ThemeBuilder

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.22
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 190, "requestCorrelationId": "23fb019f37c5c7ac"}