4 ms·
I meant rules out for the domain code that you want to be able to run in a single thread, which should be by far most of the code (unless you ensure that whatev
by jffhn 7y ago
I meant rules out for the domain code that you want to be able to run in a single thread, which should be by far most of the code (unless you ensure that whatever your code wants to wait for, has then necessarily already happened, but that seems brittle to me).
Inside of the technical layers you use to run it in multiple threads, there are of course wait/notify mechanisms (or similar).
Maybe you thought about wait implementations that would not wait but that would "help", and go on with other computations while the condition is not yet met? If not then I would like you to expand on what you mean, ideally with a few lines of code as a sample to make it clear.
- zzzcpan 7y agoI mean wait implementation doesn't have to actually wait, it just has to register an event handler and store some context to continue with. In the simplest case if we assume there is nothing else to process the condition will be met right in the next iteration and will call back that event handler and continue from that point all without any waiting.
- jffhn 7y agoOk, I was talking about actually waiting (like in "while(!condition)yield();") with more code to execute at the _same_ (*) virtual time after the wait, not taking care of having some code executed _later_, which is indeed a proper approach in our case, and what "waiting" could mean in some informal specification. (*) When doing deterministic virtual time scheduling, computations are scheduled to take place at given times, and are processed exactly at the time they are supposed to be. The time can only change once everything that had to be computed at current time has been computed (if in "as fast as possible" mode, the scheduler then just jumps the clock to the next time something is scheduled to happen) (if you want to read more about that, see "time advance request" and "time advance grant" in the HLA norm).