You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should presumably make TimedPhase thread-safe (though starting and stopping a TimedPhase multiple times is probably abusing the concept). Unfortunately, making TimedPhase thread-safe is tricky because whether or not the timer is running becomes a much trickier concept in a world where any thread could start or stop any TimedPhase at any time.
Therefore, if we wish to make the TimedPhase thread-safe, we should probably also impose a restriction: ATimedPhase can only be started once, and stopped once. Then we provide some utility methods for creating a new TimedPhase with a different name, and the same duration as the original. So something like:
Then, if people want to run a timer multiple times, they can do it through a relay style timing, where each timer still has a well-defined notion of started and stopped.
The text was updated successfully, but these errors were encountered:
I think making TimedPhase a 1-time-use thing is probably a great idea. There's definitely some more thinking to do around what the multi-start capabilities were allowing for, and seeing if it still makes sense (and if we can continue to support it), but the thread-safety is more important I think.
We should presumably make
TimedPhase
thread-safe (though starting and stopping a TimedPhase multiple times is probably abusing the concept). Unfortunately, making TimedPhase thread-safe is tricky because whether or not the timer is running becomes a much trickier concept in a world where any thread could start or stop anyTimedPhase
at any time.Therefore, if we wish to make the
TimedPhase
thread-safe, we should probably also impose a restriction: ATimedPhase
can only be started once, and stopped once. Then we provide some utility methods for creating a newTimedPhase
with a different name, and the same duration as the original. So something like:Then, if people want to run a timer multiple times, they can do it through a relay style timing, where each timer still has a well-defined notion of started and stopped.
The text was updated successfully, but these errors were encountered: