diff options
author | Ori Bernstein <ori@eigenstate.org> | 2022-09-24 19:21:27 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2022-09-24 19:21:27 +0000 |
commit | 7f835e03809b48139026dead0ad0ae21092a6e60 (patch) | |
tree | c96c2db9c170de03e3f4722f5482ddd53d8f036e /sys/src/9/port/portdat.h | |
parent | 957863b064ed01ebb1297ddd368ce5a78c957f5e (diff) |
9/port: reimplement timers to use timer wheel
when many processes go to sleep, our old timer would
slow to a crawl; this new implementation does not.
Diffstat (limited to 'sys/src/9/port/portdat.h')
-rw-r--r-- | sys/src/9/port/portdat.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h index 45a39be8e..2a674b3bb 100644 --- a/sys/src/9/port/portdat.h +++ b/sys/src/9/port/portdat.h @@ -1,4 +1,3 @@ -typedef struct Alarms Alarms; typedef struct Block Block; typedef struct Chan Chan; typedef struct Cmdbuf Cmdbuf; @@ -98,12 +97,6 @@ struct RWlock int writer; /* number of writers */ }; -struct Alarms -{ - QLock; - Proc *head; -}; - struct Sargs { uchar args[MAXSYSARG*BY2WD]; @@ -575,6 +568,7 @@ struct Timer Tval tticks; /* tns converted to ticks */ Tval twhen; /* ns represented in fastticks */ Timer *tnext; + Timer **tlink; /* a pointer to the prev nodes's next */ }; enum @@ -720,8 +714,8 @@ struct Proc Rendez sleep; /* place for syssleep/debug */ int notepending; /* note issued but not acted on */ int kp; /* true if a kernel process */ - Proc *palarm; /* Next alarm time */ - ulong alarm; /* Time of call */ + Proc *palarm; /* triggered alarm chain */ + Timer alarm; /* alarm context */ int newtlb; /* Pager has changed my pte's, I must flush */ uintptr rendtag; /* Tag for rendezvous */ |