0
votes

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.

  1. Run for 100 ticks
  2. Process terminate
  3. Timer handler calls schedule

Current operation

  1. Run for 100 ticks
  2. Timer handler calls schedule
  3. Scheduled to another process.
  4. Moments later
  5. Rescheduled to initial process.
  6. Process terminate

Can anyone suggest a general idea to solve this?

1
Is this being tried on SMP or on UP?Ganapathi Bhat

1 Answers

0
votes

It was UP. Well, maybe this was stupid question. I just solved it by doing scheduling 1 tick later, kinda hacky way. Hope there's more correct answer.