An example of a fake game, with an expensive calculation that can be pushed off to another thread.
There will be a blog post to explain this better, coming soon on https://www.worthe-it.co.za.
This demo shows two cases, one that uses threading for an ‘expensive’ calculation and one that does now.
The version without threading can be run with
cargo run --bin no-thread
The version that does uses threads, and communicates its results back to the parent thread with a channel, can be run with
cargo run --bin channels
This example is based on a Piston game engine tutorial written by TyOverby <ty@pre-alpha.com> and Nikita Pekin <contact@nikitapek.in> (https://github.com/PistonDevelopers/Piston-Tutorials/tree/master/getting-started)