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 6368305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:39:30+00:00 2026-05-25T00:39:30+00:00

I was always under the impression that poll/epoll doesn’t block. That’s why they are

  • 0

I was always under the impression that poll/epoll doesn’t block. That’s why they are used by non-blocking servers such as Nginx.

But in this Stackoverflow question it was stated several times that poll blocks.

So does poll/epoll block?

And how is poll/epoll different from async IO?

  • 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-25T00:39:31+00:00Added an answer on May 25, 2026 at 12:39 am

    Yes, poll/epoll block. Servers that spin off threads to service clients typically don’t scale as well as servers that use an I/O event notification model like epoll. poll is older and less efficient than epoll (O(n) vs O(1)).

    [UPDATE]

    Nginx is not non-blocking. When a request comes in, one of the events epoll_wait is waiting for is notified and the call to epoll_wait returns. Then Nginx loops through the signaled events servicing each one. The Nginx source code is available here … http://nginx.org/download/nginx-1.1.1.tar.gz

    Take a look at the ngx_epoll_process_events function in nginx-1.1.1\src\event\modules\ngx_epoll_module.c

    [UPDATE2]

    See also the man page for epoll_wait(2) … http://linux.die.net/man/2/epoll_wait

    #include <sys/epoll.h>
    int epoll_wait(int epfd, struct epoll_event * events, int maxevents, int timeout);
    

    Specifying a timeout of -1 makes epoll_wait(2) wait indefinitely,
    while specifying a timeout equal to zero makes epoll_wait(2) to return
    immediately even if no events are available (return code equal to
    zero).

    [UPDATE3]

    To prove to yourself that Nginx / epoll blocks, try this on Linux…

    1. Download the source and unarchive
    2. cd to the source directory
    3. ./configure --with-debug (NOTE: I had to add libpcre3-dev)
    4. make
    5. sudo make install
    6. To start nginx: /usr/local/nginx/sbin/nginx (NOTE: I had to kill apache first sudo /etc/init.d/apache2 stop)
    7. sudo gdb
    8. file /usr/local/nginx/sbin/nginx
    9. b ngx_epoll_module.c:531 (to set a break point)
    10. In another terminal window, ps -ef | grep nginx and use the PID of the nginx worker process (not the master)
    11. back in gdb, attach <PID of nginx worker>
    12. continue to resume the process

    You may have to continue a couple times but it should eventually block. Then open a browser and go to http://localhost … the debugger should then break right after epoll_wait returns.

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

Sidebar

Related Questions

I've always been under the impression that using the ThreadPool for (let's say non-critical)
I was always under the impression that when you're running a process as (domain\user)
I might be alone in this; but I was always under the impression that
I have been under the impression for that JavaScript was always asynchronous. However, I
I'm confused on Delegates. I was always under the impression that if you didn't
I have been under the assumption for a while that viewDidUnload is always called
I was under the impression that using setjmp() and longjmp() in C++ was almost
I was under the impression that file objects are immediately closed when their reference
Coming from an RDBMS background, I was always under the impression Try as hard
I'm under the impression that Python import is supposed to automatically unzip egg files

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.