I am writing a code to schedule processes on different cores of a multicore computer. I am using linux sched_setaffinity to schedule a job. However, I don't know if there is a way that the scheduler program can instantaneously/after-a-delay know whether a scheduled job has finished. Can you please tell me, how to do this? My scheduler is a C++ program, so I cannot manually see. Since scheduler is itself assigning (scheduling) the job, it may have some extra information such as PID etc.
Asked
Active
Viewed 194 times
1
-
2If the scheduled processes are children of the scheduler, use `wait(2)`. If not, see e.g [http://stackoverflow.com/questions/1157700/how-to-wait-for-exit-of-non-children-processes](here). – n. m. could be an AI Apr 08 '12 at 16:03
1 Answers
1
Perhaps you should handle SIGCHLD in your scheduler. Your signal handler function will then be called whenever a child process exits.

John Zwinck
- 239,568
- 38
- 324
- 436