diff --git a/ntnu/21v/ttk4145/summary/summary.md b/ntnu/21v/ttk4145/summary/summary.md index 4d6f699..79b2e86 100644 --- a/ntnu/21v/ttk4145/summary/summary.md +++ b/ntnu/21v/ttk4145/summary/summary.md @@ -507,3 +507,34 @@ t1(){ t2(){ * ... any other interface +#### Some standard problems/pit-falls + +* **Race condition**: A bug that surfaces by unfortunate timing or order of events +* **Deadlock:** system in circular wait + * Special case of livelock + * Does not use CPU +* **Livelock:** system locked in a subset of states + * like deadlock, but we use CPU + * Busy-Waiting is a livelock +* **Starvation:** A thread does "by accident" not get the necessary resources + + +#### Features in syncronization + +* Critical Section - Code that must not be interupted +* Mutual Exclusion - More piecesof code that must not interrupt each other +* Bounded buffer - Buffer with full/empty synchronization +* Read/Write Locks + * Readers can interleave eachother + * Writers have mutual exclusion +* Condition Syncronization - Blocking on event or status + * Guards etc. +* Resource allocation + * More than mutual exclution! + * Ref: The lock manager +* Rendezvouz/barriere - Synchronization point + * Ref: AA "end boundary" +* Communication +* Broadcast +* ... +