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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:18:21+00:00 2026-05-15T22:18:21+00:00

Out of curiousity I was wondering how Operating Systems implement waking threads that are

  • 0

Out of curiousity I was wondering how Operating Systems implement waking threads that are waiting on events/handles etc.

For example say an OS thread continually scans through a list of wait handles and executes the respective threads if necessary. Not that I believe its implemented this way as it would seem inefficient.

I think its more likely that the OS sets hardware interrupts over a region of memory that contain synchronisation primitives associated to the exposed wait handles/events and then when they are triggered it can schedule the thread with care not to schedule it more than once?

EDIT

Actually I guess what more specifically I was trying to think about but didn’t quite get to the root of was what happens to wake up a sleeping core to run a blocked thread?

  • 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-15T22:18:22+00:00Added an answer on May 15, 2026 at 10:18 pm

    In order to understand it in detail, you’ll have to take a course in operating system (or at least buy a good book on the subject) because it actually involves quite a few systems.

    Basically, however, it relates to how thread state is managed. A thread is one of a few different states at any one time: sleeping, ready or running (there’s usually more, but that’s all that is needed for the purpose of this discussion). A thread in the running state is actually running and code in the thread is executing. A thread in the “sleeping” state is not running and the scheduler will skip over it when deciding who to run next. A thread in the “ready” state is not currently running, but once another thread goes to sleep or it’s timeslice runs out, the scheduler is free to choose to schedule that thread to go into the running state.

    So basically, when you call “wait” on a mutex object, the OS checks whether the object is already owned by another thread and if so, sets the current thread’s state to “sleeping” and also marks the thread as “waiting on” that particular mutex.

    When the thread that owns the mutex is finished, the OS loops through all of the threads that were waiting on it and sets them to “ready”. The next time the scheduler comes around, it sees a “ready” thread and puts it in the “running” state. The thread starts running and checks whether it can get a lock on the mutex again. This time nobody owns it, so it can continue on it’s merry way.

    In reality, it’s a lot more complicated than that, and a lot of effort goes into making the system as efficient as possible (for example, to avoid waking a thread only to have it go immediately back to sleep, to avoid having a thread starving on a mutex that has lots of other threads waiting on it, etc, etc)

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

Sidebar

Related Questions

Out of curiosity, I'm wondering about the best (easiest, fastest, shortest, etc; make your
Out of order execution in CPUs means that a CPU can reorder instructions to
Out of interest and because it infuriates me, I was wondering if SOmebody here
Out curiosity I was wondering if there was a logical reason to have the
Just out of curiosity I was wondering how is it possible for the javascript
Just out of curiosity, I'm wondering how gmail does what it does. After looking
This is just an out of curiosity question. Let's say you have a database
This is a bit of a daft question, but out of curiousity would it
Out of curiosity, is it possible to implement an interval at which the various
I never leave backdoors in my system, but out of curiosity I was wondering

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.