(I don't know if this is the right forum to post this in, but I didn't see a clearly better one.)
Still working on my custom architecture, and I've got some open questions, mostly about issues of time.
First, I note that `runThreaded` can return a "sleep" result. Does the worker pool operate such that `runThreaded` is called repeatedly on every non-sleeping instance, and only when all are sleeping is a game tick allowed to complete? If so, is there ever a situation where a number of game ticks other than exactly the requested sleep period will pass? (Consistency with "real" time is irrelevant here, only consistency against game ticks matters.)
Second, `runThreaded` can request that `runSynchronized` be called. Will such a request ever cross a tick boundary?
Third, is `runSynchronized` ever called other than when requested by `runThreaded`? (e.g. when the machine first starts up)
Fourth, what is the preferred way to get the current tick count from inside `runThreaded`? If sleeps do not drift, this question is moot.
Last, the life cycle of a machine started and stopped in one session is pretty clear, but the exact sequence of calls when a machine is loaded is less so. Which calls are called, and in what order? When `load()` is called, is `machine.host().internalComponents()` valid and populated?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
(I don't know if this is the right forum to post this in, but I didn't see a clearly better one.)
Still working on my custom architecture, and I've got some open questions, mostly about issues of time.
First, I note that `runThreaded` can return a "sleep" result. Does the worker pool operate such that `runThreaded` is called repeatedly on every non-sleeping instance, and only when all are sleeping is a game tick allowed to complete? If so, is there ever a situation where a number of game ticks other than exactly the requested sleep period will pass? (Consistency with "real" time is irrelevant here, only consistency against game ticks matters.)
Second, `runThreaded` can request that `runSynchronized` be called. Will such a request ever cross a tick boundary?
Third, is `runSynchronized` ever called other than when requested by `runThreaded`? (e.g. when the machine first starts up)
Fourth, what is the preferred way to get the current tick count from inside `runThreaded`? If sleeps do not drift, this question is moot.
Last, the life cycle of a machine started and stopped in one session is pretty clear, but the exact sequence of calls when a machine is loaded is less so. Which calls are called, and in what order? When `load()` is called, is `machine.host().internalComponents()` valid and populated?
Link to post
Share on other sites