Manjusaka <lizheao940...@gmail.com> added the comment:

Hello guys, I some ideas about this issue

First, maybe we should add a new API named cpu_usable_count(). I think it's 
more meaningful than the os.sched_getaffinity(0)

Second, more and more people use docker to run their app today. So people need 
an official way to get the environment info, not just cpu, but the memory,  the 
network traffic limit. Because the docker is based on the CGroup in Linux, 
maybe we can add a cgroup lib as an official supported lib.

but I'm not sure about this idea, because there are some problem.

1. the CGroup is only supported on Linux. I'm not sure that adding a 
platform-specific lib is a good idea

2. Many languages are not adding cgroup official yet. Maybe there are some 
languages are optimized for the cgroup (such as Java in JVM)

----------
nosy: +giampaolo.rodola

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36054>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to