Scheduler(Dispatcher) Improvement #3268
Replies: 1 comment
-
Let me think more deeply about the Scheduler (Dispatcher). |
Beta Was this translation helpful? Give feedback.
-
Let me think more deeply about the Scheduler (Dispatcher). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wondering about the scheduler or dispatcher on the watches' level. Not only does it cause the problem I described in #2994 ,but also it makes some watches starve, like the table below (my interval is 1 minute, and fetch workers work well):
So here's how my ideal scheduler or dispatcher would work (regardless of how many fetch workers there are, the pointer equals fetch workers):
────────────────────────────────────────────────
| Queue with Fixed Oldest Pointer |
|──────────────┬────────────────┬────────────────┬───────────|
| Stage 1: Initial | Stage 2: Operation | Stage 3: Updated |
|──────────────┼────────────────┼────────────────┼───────────|
| [Head] Oldest → Newest | |
| E1(08:00) → E2(09:15) → E3(10:30) → E4(11:45) | |
| ↑ | |
| │ Pointer Always Points to Oldest | |
| └───────────────────────────────────┘ |
| |
| ▶ Pointer → E1(08:00) (oldest) |
| |
|──────────────┼────────────────┼────────────────┼───────────|
| ▼ | |
| Modify E1 time to 12:00, move to tail | |
| |
| [New Head] Oldest → Newest | |
| E2(09:15) → E3(10:30) → E4(11:45) → E1(12:00) | |
| ↑ | |
| │ Pointer Now Points to New Oldest (E2) | |
| └───────────────────────────────────┘ |
| |
| ▶ Pointer auto-moves to E2(09:15) after E1 is moved |
| |
|──────────────┼────────────────┼────────────────┼───────────|
| ▼ | |
| Next Operation: Pointer → E2(09:15) | |
| |
|───────────────────────────────────────────────────────────|
| ▶ Pointer always targets the oldest element (head of queue) |
| ▶ After modifying an element, it moves to tail, |
| and pointer resets to new head (new oldest). |
────────────────────────────────────────────────
Beta Was this translation helpful? Give feedback.
All reactions