Week 4 - Multicore Systems Flashcards
What is the cache coherence problem?
Multiple cores are running part of a program. They each have a copy of a shared object in their cache. But only the last core to write to the object will have an up to date copy.
How do you solve the cache coherence problem?
Writing to the memory location where the object is stored must cause all other copies to be removed from the cache they are in.
What is the MSI protocol?
A simple cache coherence protocol, where each cache line has a state modified, shared or invalid.
How does the MSI protocol work?
When the shared object is updated in one cache it is marked as modified, and all other copies of that object that are marked as shared are marked as invalid. The shared object is then updated in the shared cache. If another cache wants to use the shared object it will load the copy from the shared memory.
Multiprogramming
Keeping multiple programs in main memory, ready for execution
Multiprocessing
A computer using more than one CPU at the same time
Multitasking
Multiprogramming with a round robin scheduling algorithm.
How does a race condition occur?
When 2 processes modify the same shared piece of data at the same time, and so one process writes over the result of the other process, leading to an incorrect result.
What is a semaphore?
A integer variable that is shared between threads to control access to the critical section of a program.
What is a binary semaphore also known as?
mutex lock
What is a spinlock?
A locking mechanism that when a thread acquires it, makes the thread wait in a loop until the lock is available
Degree of multiprogramming
The number of processes that a single-processor system can handle efficiently
What affects the degree of multiprogramming of a system?
Amount of memory available (More memory, more processes can be stored)
Operating system (how fairly does the OS allocate resources)
Memory and disk access speeds