sched.c function
Quoted 5 lines
What exactly do you want to know about the
scheduler?
I had a wild idea to process one function that repeatedly checks the task list and find out which process is in which state
At first i retrieve the information from fork.c in do_fork() and exit.x in do_exit()
but the problem it showed me is that the information of the task at the beginnig and at the end(termination)
but the process may be in different states at different moment in between these two extremes(start -- end)
So how to know that .
I can run for_each process after certain interval of time , but rather than using timer i thought to set a value or call the function (for_each_process) whenever sheduling occurs(that is some process is going to sleep and some are awakening) that is i am getting some changes in the task list after that..
is my approch is correct ?
or should i implement timer ?
plz help me
i am sorry if some of my concepts are wrong as i am new to kernel and would be obliged if you correct me thank for your help
sounak
________________________________________________________________________
Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/
Quoted 3 lines
I had a wild idea to process one function that repeatedly checks the task list and find out which process is in which state
Why do not you do so, then? Note that on uniprocessors, all other tasks are suspended, so their state does not change in between.
Tasks do not change their state without holding a lock. (There is an exception, but it is justified.)
Quoted 4 lines
I can run
for_eachprocess after certain interval of time, but rather than using timer i thought to set a value or call the function (for_each_process) whenever sheduling occurs(that is some process is going to sleep and some are awakening) that is i am getting some changes in the task list after that..
So you want to record task state changes? That is better done at the right places in the kernel rather than traversing the task list repeatedly (the latter is not that performant).
Quoted 2 lines
i am sorry if some of my concepts are wrong as i am new to kernel and would be obliged if you correct me thank for your help sounak
I would be interested in the background: what do you need to know the task states for?
Jan Engelhardt