Semaphore implementation with mutex/cv is in the class notes. Everyone did pretty well on the scheduling problem. The only real issue was definition of "response time": "completion time" - "arrival time". Also, no preemptive interleaving (timeslicing) for plain STCF. producer/consumer with semaphores: produce/send: empty->P (lock; add message to mailbox; unlock) message->V consume/receive: message->P (lock; get message from mailbox; unlock) empty->V Deadlock scenario: two threads send/receive to each other with enough messages to almost fill the mailboxes. Another thread writes a few messages to each mailbox, enough to fill them. There are interleavings that will deadlock and some that will not. Coroutines are similar to threads but it is a different abstraction because the interleavings are determined by the program, with no scheduler. No concurrency, no parallelism, no non-determinism, and hence no need for scheduling control.