Page 1 of 1
Scheduler?
Posted: Wed Sep 25, 2002 7:40 am
by gtsphere
If i was to write a schedular, what would be the way to save the program that is running so i know to go back to it? i was thinking of a struct in c to list all of the programs by a # of something, but that probably could get slow
thanks in advance
Re:Scheduler?
Posted: Wed Sep 25, 2002 7:44 am
by dronkit
basically you save all registers from the process/task you're about to put to sleep, so when you wake it up it can recover from the last thing it was doing.
other things needed to save are the ticks the program consumed, its privilege, owner, memory statistics, etc
check out the linux sources or bsd sources for this structure... it's probably in a file called proc.h or something like that.