Multithreading

Most of you will write your games using a single thread of execution. But sometimes performance constraints demand we add another thread. This is not as hard as you think it is.

As we point out in this lecture, even if you only write one thread of code, CUGL is itself multithreaded. In addition to the main graphics thread, there is a thread for the asset loaders, and another for the audio thread. By looking at these existing threads, we can better understand how to use threads in our games.

To complement this lecture, we recommend the following reading and/or viewing:
March 9, 2022 slides no demos