Skip to content

Parallel Implementation

In this stage, you are required to write code to evolve Game of Life using multiple worker goroutines on a single machine.

The following pages are some suggested steps to help you get started, you are not required to follow them.

Your implementation will be marked against the success criteria outlined here.

Step 2

Step 2

Parallelise your Game of Life so that it uses worker threads to calculate the new state of the board.

You should implement a distributor that tasks different worker threads to operate on different parts of the image in parallel.

The number of worker threads you should create is specified in gol.Params.Threads.

You are free to design your system as you see fit, however, we encourage you to primarily use channels.

Test

To test your implementation, type the following in the terminal. You can use tracing to verify the correct number of workers was used this time.

bash
go test -v -run TestGol