By the irregularity I was thinking that operating systems implement awareness threads which are waiting on events / handles etc.
For example, an OS thread scans through the list of continuous wait operators and executes related threads when necessary, it is not that I believe that its implementation was done in this manner This can be because it is disabled.
I think it is more likely that the OS sets the hardware interrupt in the area of hard disk, in which there are synchronization permits associated with the waiting handles / events, then when they are triggered this thread Can schedule with care, not to schedule it more than once?
Edit
Actually I think that more specifically I am trying to think about, but what is the root Did not come to wake a sleeping core to run the blocked thread?
To understand it in detail, you need to buy an operating system (or at least a good book on the subject) There must be a course in it because it actually contains a lot of systems.
Actually, however, it relates to how thread status is managed. A thread is one of the few different states at one time: sleeping, is ready or running (usually more, but it is necessary for the purposes of this discussion). In the running state, a thread is running actually and the code is being executed in the thread. No thread is running in the "sleep" situation and the scheduler will drop on it, after deciding which one to run, a thread is not currently running in the "ready" position, but once a thread goes to sleep Or it overlaps the timeslace, scheduler is free to schedule the schedule to move to the running state.
So basically, when you say "wait" on the "muted" object, the OS checks whether the object is already owned by another thread, and if so Sets the status of the current thread to "Sleeping" and marks the thread as "Waiting", in particular Mute X
When the owner of the mutics ends the thread, the OS ends through all the threads that were waiting on it and when they "ready" next time around the scheduler, it is a Sees the "ready" thread and puts it in the "running" position. The thread starts and checks if it can get lock on Mute X. This time nobody is his boss, so it can continue in its enjoyable way.
In fact, it is much more complicated than that, and many attempts to make the system efficient as possible (for example, to avoid getting a thread awake to return it immediately
Comments
Post a Comment