Python Forum

Full Version: os.sched_setaffinity/os.sched_getaffinity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to Python and am using Version 3.8.
The documentation shows there to be os.sched_setaffinity and os.sched_getaffinity. but I get the error that neighter are defined.
What am I missing? Thanks for the assistance.
I guess you use Windows.
Quote:os.sched_setaffinity and os.sched_getaffinity.
Note: This methods is only available on some UNIX platforms.
Look into win32process, win32process.SetProcessAffinityMask and win32process.GetProcessAffinityMask here.
(May-14-2020, 06:04 PM)snippsat Wrote: [ -> ]I guess you use Windows.
Quote:os.sched_setaffinity and os.sched_getaffinity.
Note: This methods is only available on some UNIX platforms.
Look into win32process, win32process.SetProcessAffinityMask and win32process.GetProcessAffinityMask here.

Thanks for the reply.

I am writing an application that will run on Windows, Linux, and MacOS. I was starting on Windows.
I was hoping the Python would provide an OS agnostic environment to ease the cross-platform development.
Not a problem to setup the different platforms.
Python is trying the best to have a similar API on different platforms.
In some cases it's not possible because the APIs are too different.
The affects the low-level stuff like process handling, mmap, windows/linux specific stuff.