Multiprocessors: Difference between revisions

From COMP15212 Wiki
pc>Yuron
No edit summary
gravatar W81054ch [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:


If a processor [[cache]] data which is shared between processes – and those processes are (or could be) scheduled on different
If a processor [[cache]] data which is shared between processes – and those processes are (or could be) scheduled on different
processors – then some care is needed that the data seen is <em>coherent</em>.  This is necessary in [https://en.wikipedia.org/wiki/Cache_coherence caches], [https://docs.microsoft.com/en-us/windows/desktop/fileio/data-coherency networks] etc.  Fortunately (perhaps?) it is beyond the scope of this module.)
processors – then some care is needed that the data seen is <em>coherent</em>.  This is necessary in [https://en.wikipedia.org/wiki/Cache_coherence caches], [https://docs.microsoft.com/en-us/windows/desktop/fileio/data-coherency networks] etc.  Fortunately (perhaps?) it is beyond the scope of this course unit.)
----
----



Latest revision as of 12:07, 13 August 2019

Depends on Scheduler

Many modern computers have multiple hardware ‘cores’, meaning they can execute more than one process at once, each with its own context. However most multiprocessor architectures – at least the ones you are likely to meet day-to-day – still have a single address space and share the same memory. Thus it does not matter which processor runs a particular job at a particular time. This does not change the principle of scheduling, so it’s no big deal.

Multiprocessor scheduling

One place where this does matter a bit is in multithreading, because it can be more efficient to schedule threads from the same process together to avoid expense in context switching.

If a processor cache data which is shared between processes – and those processes are (or could be) scheduled on different processors – then some care is needed that the data seen is coherent. This is necessary in caches, networks etc. Fortunately (perhaps?) it is beyond the scope of this course unit.)


Experiment

If you can find a ‘System Monitor’ on your computer, it may show you how busy each of the cores (maybe labelled “CPU”?) is; a rolling activity graph makes a nice display. On a workstation, often it/they will be doing little which is useful; perhaps sometimes you will see one core being particularly active although which core it is may change as that process is swapped out and then back into execution by a different core.


Also refer to: Operating System Concepts, 10th Edition: Chapter 1.3.2, pages 16-19


Articles on Deadlock
Atomicity • Deadlock • File Locking • Locks • Multi Threading • Multiprocessors • Mutual exclusion • Operation Ordering • Race Conditions • Reentrancy • Semaphores • Starvation • Threads