Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:24:05+00:00 2026-06-03T13:24:05+00:00

In Java or C# or some other languages, there are non-blocking IO facilities, e.g.,

  • 0

In Java or C# or some other languages, there are non-blocking IO facilities, e.g., for sockets.

So I can give my callback functions to the non-blocking IO and once the non-blocking IO receives anything, it will call my callbacks.

I am wondering how they are implemented. If I create non-blocking IO, behind the scene, does Java or C# just create background threads for them? or the OS underlying has native support for them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:24:06+00:00Added an answer on June 3, 2026 at 1:24 pm

    On Windows there is underlying OS support for non-blocking I/O, and Microsoft’s CLR takes advantage of that. Other CLR implementations (mono) probably do as well, but I don’t know for sure. When performing async I/O on the Microsoft CLR there is not a 1-to-1 correlation between pending async I/O operations and threads (or at least managed threads) waiting for those I/O operations to complete.

    See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365683(v=vs.85).aspx for some details on the Win32-layer details. Also the information on I/O completion ports here: http://msdn.microsoft.com/en-us/library/aa365198(VS.85).aspx

    My understanding is this:

    1. I begin an async I/O operation on some application thread.
    2. If it hasn’t already, a queue will be created (well, really a kernel-level construct called an I/O completion port, which is associated with a queue in the kernel space of my application). In the .NET world a specially designated thread called an I/O completion port thread will start waiting for notifications of I/O completion on that queue. The important thing to note here is that I can make any number of async I/O requests without increasing the number of I/O completion ports.
    3. The OS will notify the application when I/O completes by enqueueing an I/O completion message on the queue. The I/O completion port thread will then handle that message by invoking the I/O completion callback in my .NET application. In the meantime, if other I/O completes, it’s results will be enqueued behind the currently-processing results.

    Caveats to the above:

    1. I am sure I got part of this wrong, but I believe the overall gist of it is correct. Eric or someone can come in and correct me where I’m off.

    2. In .NET there are multiple I/O completion port threads. I have no idea how async I/O requests are allocated amongst the various I/O completion ports. This may be an operating system feature (wherein I/O may come back on any port that the application has open).

    For Java I am sure it depends on the JVM implementation and the particular OS. I don’t know it nearly well enough to speculate beyond that.

    EDIT: Historical update, many more details here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some sort of Learning C for developers of other languages book or
In PHP and some other scripting languages have the $var syntax while Java and
I have numerous Corba servers and some other java apps (not web). I wish
I want to move some file to other place, using Java SE 1.6 So,
is there any simple/lightweight solution to change at least some of non-ASCII symbols to
I wonder why other languages do not support this feature. What I can understand
Is there any alternative in Java that may correspond to foreach{} available in other
Why did Google choose Java for the Android Operating System and not some other
I have some Java code which performs bitwise operations on a BitSet. I have
I have some Java code that is throwing out of memory exceptions after running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.