I’m currently teaching a course called “CS6868: Concurrent Programming” at IIT Madras. The goal of the course is to teach concurrent and parallel programming using OCaml 5, and then introduce OxCaml for safe and fast parallelism. I’ve covered the OCaml 5 parts, and will be starting OxCaml next. I thought it would be good to share the course materials with the community.
CS6868 assumes knowledge of OCaml, which I cover in CS3100: Paradigms of Programming. This course includes a YouTube playlist with all the lectures, notebooks, and assignments.
CS6868 builds the foundations of parallelism, reasoning about correctness through linearizability, parallel programming through spin locks, mutexes, condition variables, memory consistency models, and the basics of performance and non-blocking data structures (lock-free linked lists, queues, and stacks). Here, the course closely follows the book The Art of Multiprocessor Programming. All the code has been redone in OCaml 5. In addition to the book content, the course also covers the OCaml relaxed memory model. We also cover a fair bit of OCaml-specific tools here, including concurrent property-based testing using qcheck-lin and qcheck-stm, and data race detection using TSAN.
Following this, the course covers the basics of effect handlers, following specific parts of Control structures in programming languages: from goto to algebraic effects. We then build a full-fledged Go-like, multicore-capable concurrent programming library with lightweight threads, buffered channels, selective communication (in the vein of Concurrent ML), nested parallel programming (as in domainslib), and basic asynchronous IO (as in Eio).
There is a growing collection of course projects, which should be doable if you’ve gone through the course materials. Let me know if you have ideas for course projects.
The course tries to bring together the content from many tutorials we have done in the past. Let me know if you have feedback. I’m open to accepting PRs fixing small issues, but given that this is an ongoing course, any large PRs will likely not be accepted. I hope you will enjoy working through this as much as I had fun making it.