Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to see the scheduling of a process on linux? #1778

Closed
quicknir opened this issue Jun 26, 2020 · 3 comments
Closed

A way to see the scheduling of a process on linux? #1778

quicknir opened this issue Jun 26, 2020 · 3 comments
Labels

Comments

@quicknir
Copy link

There's a very good chance I missed this, but I didn't see how to check how a process is scheduled in linux. Whether the process/thread has been setup to use round robin, fifo, other, etc, scheduling. https://man7.org/linux/man-pages/man7/sched.7.html

@giampaolo
Copy link
Owner

giampaolo commented Jun 26, 2020

It terms of scheduling / priority pstuil.Process class provides:

Some of these overlap with the sched stuff in the os module:
https://docs.python.org/3/library/os.html#interface-to-the-scheduler
...so I believe you're looking for those ones instead. At the moment psutil won't let you handles fifos. etc.
It's something which could be included though. I've never investigated that part of the os module.

@quicknir
Copy link
Author

Yeah, I saw those other things, scheduling is conceptually nearby so I figured it was there somewhere. Thanks for pointing me to the os API, I admit that I didn't realize until this moment that os itself had so much :-). I do think access to the scheduling for a process would be nice, it seems relatively straightforward insofar as just calling to the underlying function. If you're interested in adding such I could leave this open, otherwise I can close. Cheers!

@giampaolo
Copy link
Owner

I think all the sched-related stuff is already provided by the above functions, which basically overlaps with os.sched_* functions. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants