Thanks legume!
I have been using register for single update for years. In fact one of the original beta testers for the CK told me about this "pit fall" the same week the CK dropped.
So lucky me I was able to avoided a big problem others had to learn the hard way.
What still gives me a headache is the multi-threading. I was wondering how that affected the thought experiment.
I was much more comfortable in a ONE THING HAPPENS AT A TIME programming environment.
In Oblivion I figured out some amazing tricks that can only work in that kind of environment.
Such as moving an invisible dead actor from one combatant to another to do push actor away tricks by putting the token actor at just the right elevation to the target actor in the right FRAME. I could make one actor aikido flip another in Oblivion where the actors ragdoll would tumble feet over head in the air in a very realistic way.
The entire cell of actors could be handled with one token actor because I knew that for that one frame that token actor was where they needed to be and not yanked off by another script before I was done or locked by another thread.
So to be more clear on what I want to do, I have a long calculation (using many stat and condition cheeks) that is done and then applied to the actors stamina each 0.3 second using Reg For Single update.
And as for ALL my mods this has to work the same for all actors not just the player.
Even using a "this much time has passed" modifier in the calculations this still gives me an erratic stamina bar in low frame rate areas. What I am trying to do now is only do the calculation every 2 seconds but apply the running total every 0.3 seconds doing it all in the same script. I can do this by checking the seconds passed and only allowing the calculation every 2 seconds but the stamina change each 0.3.
I was wondering if I could separate the two by shooting them off into two different threads?
But I am starting to realize I should use two separate magic effects for this so that the stamina driver is not dragged down by the calculation script.
I am assuming that even with the two separate threads going, because they are in the same script the stamina driver will still get dragged down anyway by the calculations part.