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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:04:39+00:00 2026-06-16T00:04:39+00:00

Thread T1 locks mutex M and waits on condition C (releasing M ). Thread

  • 0
  1. Thread T1 locks mutex M and waits on condition C (releasing M).

  2. Thread T2 locks mutex M and signals condition C.

In literature it’s stated that once C is signaled, T1 wakes up and reacquires M.

I was left doubtful for what happens with T2 since it had M acquired before signaling C.

What happens to T2 regarding M which was acquired before signaling?

  1. Does T1 gets ready but blocked, executing only after T2 releases M, for it to be reacquired?

  2. Does T1 gets ready and executes while T2 gets blocked till M gets released, for it to be reacquired?

  3. They just execute concurrently, T1 with M acquired, T2 with M released (or also acquired?)

  4. ?

  • 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-16T00:04:40+00:00Added an answer on June 16, 2026 at 12:04 am

    Signalling the condition C wakes up the thread T1, then it has to reacquires the mutex M by locking it. In order to do so, T2 must release M first.

    So the answer is, T1 wakes up on signal, waits to acquire M, T2 releases M, T1 acquires M, T1 and T2 execute concurrently.

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

Sidebar

Related Questions

Can the condition when single process/thread is blocked trying to acquire the same mutex
I'm sure mutex isn't enough that's the reason the concept of condition variables exist;
Imagine a thread blocks on a condition variable: pthread_mutex_lock (mutex); do_something (); pthread_cond_wait(cond, mutex);
The question here is: If a thread that acquiring an exclusive lock to an
I have a java code that looks like this: //UI thread //Some code Job
I have a multi-threaded application that is using pthreads. I have a mutex() lock
boost::condition_variable cond; boost::mutex mutex; //thread #1 for(;;) { D * d = nullptr; while(
According to the man page, pthread_cond_broadcast wakes up all the threads that are waiting
I am trying to write a class that would run a thread upon its
boost::condition cond; boost::mutex access; void listener_thread() { boost::mutex::scoped_lock lock(access); while (true) { while (!condition_check_var)

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.