simulation
simulation copied to clipboard
Simulation should support task prioritization
Related to #5, it's desirable that Simulation can test errors which occur due to task execution ordering. Currently, this can be done by adding a random Delay to each spawned task. This may not be sufficient for large number of tasks though, as the default Timer implementation has a 1ms granularity. Having a granularity this high may cause undesirable timeouts for other parts of the system.
I think the easiest way to fix this is to switch timer implementations to something based on nanoseconds or microseconds. Further, each spawned task would have a Delay of at least 1 nanosecond, This would also fix #5, as users could use the logical clock via Now::now() to see the precise state a simulation is in.