![]() Grabbing and freeing contexts is not good for performance, and so a better model is needed. In a task based model, the game system would either need a separate audio context for each thread in the thread pool, or else it would need to acquire a new context each time foot steps are to be played. The problem for a task based threading model is that often the hardware components or drivers, such as the audio system, expect your application to acquire a context to use them, and those contexts are often restricted to a single thread. For example, a typical game might have an audio component which is responsible for playing the chilling foot-steps sounds as a foe approaches you in the game. ![]() The game engine project is such a case.Ī video game engine has many components which run constantly, throughout the lifetime of the game process. This model works very well in most cases, but there are some cases in which it is not ideal. ![]() ![]() In such a model, the main thread prepares a number of tasks and throws them at a pool of threads to be executed. Many multi-threading or parallel programming libraries adopt a task model. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |