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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:11:23+00:00 2026-05-22T02:11:23+00:00

I have a multithread linux program which uses epoll(7). The epoll(7) man page says

  • 0

I have a multithread linux program which uses epoll(7). The epoll(7) man page says when one of its fds gets closed, this fd will be automatically removed from the epoll set. My question is what if a fd of the epoll set gets closed in one thread while the epoll set is being polled in another thread concurrently without synchronization. Will the program get corrupted or will the kernel synchronize this access automatically?

Thanks

Feng

  • 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-22T02:11:24+00:00Added an answer on May 22, 2026 at 2:11 am

    The fds in an epoll set are maintained by the kernel, so you are safe – the kernel handles any necessary synchronization.

    That said, there remains the possibility that an event on the fd comes in on the other thread just before the fd is closed. Thus it might be possible to have an event from an fd which no longer appears to be in the set. With a carefully designed program this shouldn’t cause a problem.

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

Sidebar

Related Questions

If you have a multithreaded program (Linux 2.26 kernel), and one thread does something
I a have a multithread application (MIDAS) that makes uses of windows messages to
I have a single-threaded linux app which I would like to make parallel. It
I have a login.jsp page which contains a login form. Once logged in the
see basically i have one multi-thread application in which i want to see the
I have a layered application in Java which has a multi thread data access
I have a multithreded application in perl for which I have to rely on
Let's say I have a multithreaded C++ program that handles requests in the form
I'm developing a multithreaded program running on Linux (compiled with G++ 4.3) and if
On my linux box, I have 2 libraries: libfoo1.a and libfoo2.a and they both

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.