Sunday, 15 January 2012

python - equally busy cpu cores -


I was recently identified on computational intensive dragon program (without threading), which is Windows (Win8.1 x 64) is not under CPU occupation (of my 4 logical, 2 physical core) completely occupied, instead of every logical core is busy up to ~ 25%. In this all one core is 100% busy. Does windows work to spread, but not really good? Is it something to do, to keep the core as cold as possible? Or is there something to do with Python? I run the same program under Linux and the work I do here works (one core is 100% busy)

Do you really see in Windows what is expected of default behavior of interactive CPU scheduler (Windows or Linux, other Unix version or macros)?

When you execute a thread, the OS is running to send a timed interrupt (clock interrupt) which is the kernel space (the OS process is running) from the user space (the app you are running) And enables it to restart the process to run the OS, after the other processes, the same (or the other) CPU core had its own share of "CPU Pie". This principle is similar if Your process is the main CPU consumer (usually there are processes besides your background)

This behavior is an extremely important feature of interactive scheduling mode (which is the default for most OS nowadays, because They are well interactive ...) because it allows all running processes to get a piece of CPU resource without any appetite. Each process is to take CPU sharing between them the entire CPU resources and "CPU hog" and by not giving it back, allowing each process running to "interactive".

Now, you can improve that behavior, for example, by setting a core in relation to a process or by giving "real time" priority to the process what did you do

< P> Any of them can cause the process to run on the same core (affinity is trivial, ask you to run from OS only on 1 core). Realtime bus stop interrupts the process. This makes your machine less interactive, but it also prevents the walking process, so it starts moving on to the same core.

Now, about the behavior you specify on Linux. I think this is one of the following two explanations:

  1. You are in no way determining the process of running on SCHED_FIFO (this is "real time "Windows is equal to)

    To verify it, use the PID of your process and execute

      chrt -p & lt; Your Process PID & gt;  
  2. You misunderstood a device that showed you that the process is running on a single core, in fact it spreads all over the core is. If you can elaborate on how you reached the conclusion that it runs on all the core in Linux then I would be happy to hear it.


No comments:

Post a Comment