Ordering Flashcards
what is asynchronous execution
we cannot predict the order two threads will be scheduled
what is a race condition
an element that has different values based on the synchronisation of operations before it
how can we create ordering or synchronisation
barrier
thread join
mutual exclusion
asynchronous message passing
synchronous message passing
what is a thread join
two threads join together and proceed as a single thread
what is asynchronous message passing
send the appropriate information before proceeding
what is synchronous message passing
at a determined point, the first process blocks and waits for the other to reach its communication point. then a message is sent
what is mutual exclusion
a mutex is a Boolean flag that prevents or allows progress.
it controls access to a critical section.
stored in main memory
when do race conditions occur
when behaviour is non deterministic
what is a semaphore
a means of implementing access control.
start with a value that is incremented (v) and decremented (p)
if value is 0, process must block. when exiting, signal v will increment the semaphore
what is signal and wait
IPC
there are times a process should not proceed until something else has happened.
in a critical section: process must wait, then sigal once it has left
in semaphores: p and v
in queues: if a process tries to read an empty buffer it must wait until it receives a wakeup
what is a memory barrier
instruction that causes all memory operations before it to be complete before starting operations after it.