1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-25 19:57:36 +00:00

TIMER: Fix various inconsistent timing behaviors

- Support for arbitrary long wait intervals in sim_activate_after with
   precisely correct delays aligned with the calibrated clock once
   per second.
- Proper handling of calls to sim_cancel for calibrated timer units
- Properly allow stopping of calibrated clock by calling sim_rtcn_calb
   with a ticksper == 0
- Only schedule asynchronous timer activities for delays longer than
   the minimal OS sleep time
- Only wake asynchronous timer thread to queue new timer events
   that are shorter than the currently shortest scheduled event
This commit is contained in:
Mark Pizzolato
2016-12-26 12:42:25 -08:00
parent 257738a4e0
commit aa82b57d10
4 changed files with 151 additions and 67 deletions

View File

@@ -542,6 +542,7 @@ struct UNIT {
void *up8; /* device specific */
void *tmxr; /* TMXR linkage */
t_bool (*cancel)(UNIT *);
double usecs_remaining; /* time balance for long delays */
#ifdef SIM_ASYNCH_IO
void (*a_check_completion)(UNIT *);
t_bool (*a_is_active)(UNIT *);
@@ -556,7 +557,7 @@ struct UNIT {
/* Asynchronous Timer control */
double a_due_time; /* due time for timer event */
double a_due_gtime; /* due time (in instructions) for timer event */
int32 a_usec_delay; /* time delay for timer event */
double a_usec_delay; /* time delay for timer event */
#endif
};