trillek-team/trillek-client-core — pull request #13 by catageek (2014-04-27 00:07:18+00:00)
Title: Add a scheduler running the system functions once at each frame.

Each system registered has a dedicated thread that executes its 2 main functions every 1/60 second.

When not running the system functions, the scheduler assigns pending tasks to threads. The tasks can be split in small blocks to allow collaborative behaviour (the NetworkController runs entirely asynchronusly using the scheduler). The keyboard and mouse controllers should us asynchronous tasks only.

For illustration, a FakeSystem has been added, and its 2 functions implemented to print a message each time they are executed.

The scheduler uses a constant number of threads and limits the number active threads. The implementation is still a work in progress, but the interface should not change.