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

  • Home
  • SEARCH
  • 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 923113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:08:33+00:00 2026-05-15T19:08:33+00:00

I am aware of event driven I/O like select, poll, epoll, etc allow someone

  • 0

I am aware of event driven I/O like select, poll, epoll, etc allow someone to build say a highly scalable web server, but I am confused by the details. If there is only one thread of execution and one process running for the server, then when the server is running its “processing” routine for the ready clients, isn’t this done in a serial fashion to process the list of ready clients since it can’t be scheduled on multiple cores or cpus? Moreover, when this processing is happening…wouldn’t the server be unresponsive?

I used to think this was the reason people used thread pools to handle the event I/O on the backend, but I was confused when I heard recently that not everybody uses thread pools for their applications.

  • 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-05-15T19:08:34+00:00Added an answer on May 15, 2026 at 7:08 pm

    Hmmm. You (the original poster) and the other answers are, I think, coming at this backwards.

    You seem to grasp the event-driven part, but are getting hung up on what happens after an event fires.

    The key thing to understand is that a web server generally spends very little time “processing” a request, and a whole lot of time waiting for disk and network I/O.

    When a request comes in, there are generally one of two things that the server needs to do. Either load a file and send it to the client, or pass the request to something else (classically, a CGI script, these days FastCGI is more common for obvious reasons).

    In either case, the server’s job is computationally minimal, it’s just a middle-man between the client and the disk or “something else”.

    That’s why these servers use what is called non-blocking I/O.

    The exact mechanisms vary from one operating system to another, but the key point is that a read or write request always returns instantly (or near enough). When you try to write, for example, to a socket, the system either immediately accepts what it can into a buffer, or returns something like an EWOULDBLOCK error letting you know it can’t take more data right now.

    Once the write has been “accepted”, the program can make a note of the state of the connection (e.g. “5000 of 10000 bytes sent” or something) and move on to the next connection which is ready for action, coming back to the first after the system is ready to take more data.

    This is unlike a normal blocking socket where a big write request could block for quite a while as the OS tries to send data over the network to the client.

    In a sense, this isn’t really different from what you might do with threaded I/O, but it has much reduced overhead in the form of memory, context switching, and general “housekeeping”, and takes maximum advantage of what operating systems do best (or are supposed to, anyway): handle I/O quickly.

    As for multi-processor/multi-core systems, the same principles apply. This style of server is still very efficient on each individual CPU. You just need one that will fork multiple instances of itself to take advantage of the additional processors.

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

Sidebar

Related Questions

I'm aware of the principles behind event driven programming but would nevertheless try to
How can my JavaScript detect if an event is available? I'm aware of some
I'm aware of the different event models in JavaScript (the WC3 model versus the
Im all aware about services like github and such which provide a really nice
Im fully aware of the problem with static event handlers from a GC perspective
I've got a little issue with the focus event that I just became aware
How I can aware of a Task finished ?I want a thing like RunWorkerCompleted
I'm trying to prepare to build a database driven .net application and I have
I am aware that this is somewhat a re-post, but I feel like re-posting
I'm aware of the usual list of open source licenses, so I'm not even

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.