Jump to content

OnUpdate events not running!


xkkmEl

Recommended Posts

I have this strange issue with OnUpdate events not being triggered in various circumstances.

 

I have a qvRunner object that runs an update chain, in order to manage a job queue with multiple serving threads. In its idle state, qvRunner keeps a 20sec SingleUpdate chain, just to make sure its stays persistent in RAM. When jobs are added to its queue, it then starts SingleUpdates on a 0.05sec schedule to spawn new processing threads (up to 13 parallel threads). When the 13 threads are started, or when the job queue becomes empty, it reverts back to its idle state (with a 20sec singleupdate chain).

 

Every once in a while, though, the OnUpdate events stop... If I save and reload, the updates resume normally; I inject no additional update requests so I assume these are my original update requests finally triggering. Also, when I look into the save files (using resaver), I see no suspended stacks, no active scripts and no function messages associated with my object names. It does not look like my scripts are getting stuck; it looks like they are in place, idle and waiting for events that never come.

 

I have implemented a "Heartbeat" object, that does a ping-pong of ModEvents to track these missing update events. Every time qvRunner calls RegisterForSingleUpdate( n), it also calls SendModEvent( "qvHeartbeat", "OnMissedHeartbeat", n). The heartbeat detects when a requested update is at least 5 seconds late, and complains (via a notification) and sends a ModEvent to qvRunner to force-restart the update chain.

 

The heartbeat mechanism confirms that the update events are actually requested, and do not in fact trigger. It is partially effective in getting them restarted (in combination with going through load doors, it eventually restarts the update chain, but it takes 2-15mn of play).

 

Does anyone have any insight on what is happening, what triggers it, and how to manage this better? I think it is an attempt by the game engine to reduce its workload. It looks like COT weather, especially the thunder storms and blizzards, triggers it readily, though I have other situations where it triggers which I cannot link to COT.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...