• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

How to redirect threads to specific Processor in MP Enviroment

Hi,
I would like to know if it is possible to manage processes/threads to be proceeded by a specific processor in Multi-Core or Multiple Processor enviroment.

The main idea behind is :
I am using diversified programming (A Code and B Code for the same function).
In order to control possible faults in CPU, I would like to let these two
different functions to be proceeeded in two CPUs.

Eg:
Processors:
-----------
Processor A
Processor B


Threads:
-----------
Thread 1   =-------------->Processor A
Thread 2   =-------------->Processor B
Thread 3   =-------------->Processor A
Thread 4   =-------------->Processor B
Thread 5   =-------------->Processor A
      .                                     .
      .                                     .
      .                                     .

Is that possible to practice that kind of programming.


Regards,
Cem IMRE
0
mike_air
Asked:
mike_air
2 Solutions
 
ravenplCommented:
man sched_setaffinity
0
 
Dragon_KromeCommented:
Here you have some links with more detailed information about setting the cpu affinity, with examples:

http://www.linuxjournal.com/article/6799
http://cs.haifa.ac.il/courses/AdvancedOS/ParallelScheduling.pdf

Also, there are CPUSETS; perhaps you could use them too.

http://lwn.net/Articles/127936/
http://www.bullopensource.org/cpuset/


I'm sure you can find more if these aren't enough.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now