I've had a further look at the way this watchdog has been implemented, but there are serious problems during start-up.
The watchdog assumes the various threads complete during the watchdog-interval, and they report this completion.
But during startup there are several instances when time-consuming actions are performed in loops within the thread, which will therefor not terminate within the watchdog timing, and the thread will time-out. The length taken by these loops depend on route configuration, activity or timetable set-up like no. of AI trains and timing of first AI train w.r.t. to start of player train, and computer configuration (file loading time).
There are at least five such routines which cause problems :
- Signalling : Signals.cs : loading of all world-files to obtain signal information.
- Activity : AI.cs : loading of activity traffic information.
- Timetable : ProcessTimetable.cs : loading of timetable path information.
- Timetable : ProcessTimetable.cs : loading of train details information.
- Activity and Timetable : AI.cs : AIPreRun.
There may be more which I have missed so far, depending on route configuration.
There are three possible ways to sort the problem :
- Rewrite said routines such that they will allow the thread to terminate.
Does not seem a very realistic solution.
- Add 'pings' to the said routines.
Could be done, but has the risk that, depending on route and computer configuration, there still may be other parts of the start-up sequence where similar problems could occur.
- Activate the watchdog only when the player train is started, and 'normal' processing begins.
This seems to me to be the safest way out.
Regards,
Rob Roeterdink