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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:56:19+00:00 2026-06-04T01:56:19+00:00

there is race condition in implementation that could allow a signal to be missed.

  • 0

there is race condition in implementation that could allow a signal to be missed. The problem is pthread_cond_wait function is not atomic? same is discussed in the comment in the file
https://github.com/android/platform_bionic/blob/master/libc/bionic/pthread.c

Shouldn’t this operation be atomic ?

  • 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-04T01:56:21+00:00Added an answer on June 4, 2026 at 1:56 am

    You should not be worrying about this “race condition”. As per the comment, it can only happen if one thread goes to sleep at a pathological place, stays asleep there for a long time, and other threads signal the condition variable a pathological number of times (no more, and no less).

    This is actually inherent in many perfectly reasonable low-level implementations of condition variables, especially when based on futexes. Basically, after the userspace code atomically checks the value of an integer variable, it calls into the kernel to perform a blocking operation, but it instructs the kernel to abort the operation if the value of the integer variable has changed in the meantime. The pathological case is when the integer variable has wrapped all the way around its range an exact integral number of times (while the first caller stayed blocked the whole time!).

    If you want to read more than you ever wanted to know about really subtle details like this, read this paper.

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

Sidebar

Related Questions

Race condition could occur even when check-and-act action is not involved, for example in
Are there any race condition issues when using NSNotifications within a single thread? Here
Is there a tool that analyses .NET code and finds race conditions? I have
I've seen there are some race condition analysis tools for C++, C and Java.
I have a race condition in which I do not want an AJAX call
Why there is a race condition according to valgrind with the following code? #include
There are load balanced tomcat web servers. Every request could be served by different
I have a unique problem. There are two processes (P0 and P1) trying to
Does this cause a race condition with MySQL (InnoDB): Start Transaction. Try to get
I was just reading How to avoid a database race condition when manually incrementing

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.