Python Forum
os.sched_setaffinity/os.sched_getaffinity
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
os.sched_setaffinity/os.sched_getaffinity
#1
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.
Reply
#2
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.
Reply
#3
(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.
Reply
#4
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.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020