title: Operating System Implementation of events/signals/wait handles
body: <p>Out of curiousity I was wondering how Operating Systems implement waking threads that are waiting on events/handles etc.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>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?</p>