I'm making a scheduler with simple Unix style educational OS. I have the problem: How to generally block timer interrupt, when it overlaps with process end or sleep?
In the moment of overlapping, timer handler called before the process move on to sleep or end state.
Wanted operation -timer interval is 10 ticks for example.
- Run for 100 ticks
- Process terminate
- Timer handler calls schedule
Current operation
- Run for 100 ticks
- Timer handler calls schedule
- Scheduled to another process.
- Moments later
- Rescheduled to initial process.
- Process terminate
Can anyone suggest a general idea to solve this?