Hi.
I'm trying to implement preemptive multitasking, for this I'm going to use PIT(irq0) for this task.
I use this article to switch between tasks.
How I'm going to do this, I'll keep some sort of table with processes and their priorities.
While interrupting IRQ0(for example every 50 MS), I will call the task scheduler, which will change the priorities of various tasks and call yeild(), but I don't think that article is particularly suitable for me.
What can you advise me? Can there be any examples? Articles?
Thanks.
Using PIT for multitasking
Re: Using PIT for multitasking
Hello,
From my experience in multitasking, you will want to switch tasks much more often, like several hundred times a seconds. About 3 PIT ticks. The PIT is what I use, it works great. Besides that, it sounds good, but you should only change priorities when a high priority process is taking up too much time. Also, consider having one queue per priority. The tutorial you are looking at is about cooperative multitasking, which is much different. I recommend making it all on your own. You must understand everything, as multitasking is quite complicated. It took me a full month to implement a very simple scheduler! I haven't implemented priorities yet, so can't be much more help. Anyway, it sounds great! Good luck implementing it!
From my experience in multitasking, you will want to switch tasks much more often, like several hundred times a seconds. About 3 PIT ticks. The PIT is what I use, it works great. Besides that, it sounds good, but you should only change priorities when a high priority process is taking up too much time. Also, consider having one queue per priority. The tutorial you are looking at is about cooperative multitasking, which is much different. I recommend making it all on your own. You must understand everything, as multitasking is quite complicated. It took me a full month to implement a very simple scheduler! I haven't implemented priorities yet, so can't be much more help. Anyway, it sounds great! Good luck implementing it!