A simple question on multithreading

  • Thread starter Alexander Dong Back Kim
  • Start date
A

Alexander Dong Back Kim

Hi all,

I'm having a fun with multi threading programming. My target machine
has 8 Intel Xeon CPUs. Working environment is Linux based and using g+
+. Boost library is being used for my fun.

My question is is there any possible way to bind a thread to a
specific CPU among 8 CPUs? If it is possible would you please let me
know where I have to start digging? +)

Cheers,
Alex
 
I

Ian Collins

Alexander said:
Hi all,

I'm having a fun with multi threading programming. My target machine
has 8 Intel Xeon CPUs. Working environment is Linux based and using g+
+. Boost library is being used for my fun.

My question is is there any possible way to bind a thread to a
specific CPU among 8 CPUs? If it is possible would you please let me
know where I have to start digging? +)
A linux group would be good place to start!
 
C

Chris Thomasson

Alexander Dong Back Kim said:
Hi all,

I'm having a fun with multi threading programming. My target machine
has 8 Intel Xeon CPUs. Working environment is Linux based and using g+
+. Boost library is being used for my fun.

My question is is there any possible way to bind a thread to a
specific CPU among 8 CPUs? If it is possible would you please let me
know where I have to start digging? +)

Check out the 'pthread_getaffinity_np()' and 'pthread_setaffinity_np()'
functions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top