LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Possible to detect when a process has been interrupted by the CPU? (https://www.linuxquestions.org/questions/linux-kernel-70/possible-to-detect-when-a-process-has-been-interrupted-by-the-cpu-654878/)

jqweezy 07-10-2008 10:43 AM

Possible to detect when a process has been interrupted by the CPU?
 
Hello All,

Is it possible to detect when a particular process is interrupted? For example, let us say that we have three process running A, B, C. The scheduler is constantly switching tasks between A, B, and C. What I want to be able to do is detect when the CPU interrupts process B (here I want to clear an arbitrary flag) to run another process. Once the other process has completed, or the time quanta has expired, process B will resume. Once process B resumes, I want to set my arbritary flag that I had cleared earlier. Is this possible? Would I have to create my own kernel module, or would I have to modify the CPU scheduler (hopefully no)?

I am looking for any insight or help that could point me in the right direction. Thanks for your help and I look forward to your feedback.

Here is some info on my system:
2.6.23-gentoo-r9
i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux

Regards,
JQ

unSpawn 07-10-2008 11:02 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...by-cpu-654869/.


All times are GMT -5. The time now is 04:55 AM.