Results 1 to 4 of 4

Thread: How to use only one processor to run my program

  1. #1
    Join Date
    May 2013
    Beans
    4

    How to use only one processor to run my program

    I need help to figure out how to run my program using only one processor...I'm using AMD Athlon(tm) II Dual-Core M320 and will like to disable the other processor from running.. I only need one core to execute my code..

  2. #2
    Join Date
    Jan 2007
    Beans
    6,537
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How to use only one processor to run my program

    Unless you deliberately write your program to be multi-threaded then it'll only use a single core. You can't stop other processes from using the other core while your stuff is running though.

  3. #3
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,515
    Distro
    Ubuntu Development Release

    Re: How to use only one processor to run my program

    If you want to run your computer using just one CPU, then you could boot using "maxcpus=1". See also this thread.
    If you want to have your computer running normally but force your program to only use one CPU, and not have the scheduler change CPU's sometimes then do (to use CPU 0)
    Code:
    taskset -c 0 ./your_program
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  4. #4
    Join Date
    May 2013
    Beans
    4

    Re: How to use only one processor to run my program

    Thank.. It work perfectly.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •