ccc

module
v0.0.0-...-69f49ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2019 License: MIT

README

📑 Concurrency Crash Course

A quick introduction to concurrency in Go, for people familiar with Imperative or Object-Oriented programming.

Each lab is designed to take 2-3 hours depending on your previous experience. The first 3 labs have associated preparation lectures. It is recommended that you spend an hour before each lab, going through the lecture and playing with the provided code.

Lab 1⃣ - Introduction to imperative programming in Go

You will become familiar with Go's syntax and features. The lab focuses on those aspects of the language that are relevant and useful for the future labs.

This lab will assume that you already know at least one other Imperative or Object-oriented language. A basic understanding of pointers is also required.

Lab 2⃣ - Basic concurrency

This lab will teach you basics of concurrent computing. You will be introduced to channels and goroutines, which are based on the CSP message-passing model for concurrency. In the final question you will be given working serial code and asked to make it faster by parallelising it.

No previous experience of using threads or channels is required.

Lab 3⃣ - Advanced concurrency

You will get to experience more complicated patterns in concurrent programming. You will get to modify your quiz from Lab 1 to include a 5s timeout and you will investigate costs and benefits to performing merge sort using hundreds of goroutines.

Lab 4⃣ - Beyond channels

This final lab will focus on concurrency without using channels. The classic memory-sharing model is introduced, including POSIX-style semaphores, mutexes and condition variables. The final question of this lab asks you to write a Bank Simulator using both memory-sharing and channels, asking you to apply all the skills you have gathered throughout the course.

Note that this lab does not yet have an associated lecture. You will need at least a basic understanding of mutexes and semaphores to succeed.


The above lectures and labs were originally developed for University of Bristol Concurrent Computing Unit (COMS20001) by Chris Gora under the supervision of Dr. Sion Hannuna.

Directories

Path Synopsis
lab1
lab1_code/quiz command
lab2
lab2_code/ping command
lab3
lab3_code/merge command
lab3_code/quiz command
lab4
lab4_code/bank command
NOTE: You should not have to modify any functions or methods in this file (other than to add debugging prints).
NOTE: You should not have to modify any functions or methods in this file (other than to add debugging prints).
lab4_code/sum command
lec1
lec1_code command
lec2
lec2_code command
lec3
lec3_code command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL