Watch a video introduction to the course on YouTube.
An introduction to advanced control-structures with an emphasis on concurrency and writing concurrent programs at the programming-language level. Programming techniques and styles are examined to express complex forms of control flow, such as multi-level loop exit, data-structure iterators, exceptions, coroutines, and concurrency. Students will learn how to structure, implement and debug concurrent programs.
CS 343 is intended for Computer Science students planning to do advanced high-level programming.
Prerequisites: CS 350 or SE 350; Computer Science students only.
Used in Course: C++.
Assumed Background: Sequential C++ programming skills.
Course notes are required.
3 hours of lectures per week. Normally available in Fall and Winter.
Multi-exit loops, multi-level exits, exceptions (termination/resumption), iterators.
Multiple stacks, context switching. Semi and full coroutines.
Starting multiple threads, synchronizing and communication among threads. Ready queue, thread states, interrupts.
Software and hardware solutions for critical sections. Dekker and Peterson algorithms. Test and set.
Binary and counting semaphores. Baton passing and split binary semaphores. Bounded buffer and readers/writer. Semaphore implementation.
Race condition, starvation, live-lock, deadlock: synchronization and mutual exclusion. Examine deadlock: prevention, avoidance and recovery.
Conditional critical regions, monitors, tasks. Internal and external scheduling of tasks. Rendezvous. Client/Server.
Server: buffering, secretary, administrator, workers, courier. Client: sync/async communication, tickets, call-backs, futures.
Concurrent programming languages: Ada, Java, Actors, Linda (tuple space). Threads/locks: pthreads. Threads/message-passing: PVM/MPI. Kernel threads (parallel execution). Remote procedure/method call. Distributed communication: sockets.