How to redirect threads to specific Processor in MP Enviroment

Posted on 2006-03-30
Last Modified: 2010-05-18
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.

Processor A
Processor B

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.

Question by:mike_air
    LVL 43

    Accepted Solution

    man sched_setaffinity
    LVL 5

    Assisted Solution

    Here you have some links with more detailed information about setting the cpu affinity, with examples:

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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now