Architecture for multithreading

Started by
10 comments, last by elFarto 14 years, 4 months ago
Quote:Original post by elFarto
Quote:Original post by phantom
As a side note, I'm a fan of the design where you have everything update its logic at once, then run a 2nd 'sync' step.
I'm a fan of global state being transactional. Each entity's update process uses the latest global state and is not effected by state changing while it's running (ie. starting a transaction 'freezes' your view of the world). While this doesn't solve all the problem, and introduces live-locks, it seems to work quite well and it neatly side steps synchronisation issues (deadlocks).
Does this approach support deterministic simulations? Or would the random order of threaded updates cause the order of actions to be random as well?
With the 2-step approach all entities are working from the same 'snapshot' every update, so you can still enforce determinism.

It's not an essential feature, but is required by some games.
Advertisement
Quote:Original post by Hodgman
Does this approach support deterministic simulations? Or would the random order of threaded updates cause the order of actions to be random as well?

No, it doesn't support deterministic simulations, since as you pointed out you can't control the order in which the update occur.

Regards
elFarto

This topic is closed to new replies.

Advertisement