Set Processor Affinity to group of cores


 
Thread Tools Search this Thread
Top Forums Programming Set Processor Affinity to group of cores
# 1  
Old 12-16-2012
Set Processor Affinity to group of cores

Hi
on multi-core system - I know I can set each process to run on specific core (Processor Affinity).
If I want to set process (which contains several threads) to run on group of core, how can I do it ?

For example:
If we have 8 core,
and two process each process contain 4 threads.
And I want the first process will run on cores 0,1,2,3 and the second process will run on cores 4,5,6,7.
How can I do it ?
# 2  
Old 12-17-2012
We don't see your OS mentioned - this is OS specific.

Code:
Linux - Command line taskset [processor mask]
           Program         sched_setaffinity() which uses the cpu_set group of macros

# 3  
Old 12-17-2012
Or you can use the GNU-specific pthread_setaffinity_np() to set CPU affinities on a per-thread basis.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

How to change pset.size value in processor set in Solaris zone?

Hi I have a pool name yuk-pool and its associated pset is yuk-pset. It has a min value is 20 and max value is 56. But size field has 48 value . This same pool is assign to 4 local zones. Whenever Cpu usage is high on one local zone it impact the cpu usage at other local zone as well during high... (1 Reply)
Discussion started by: sb200
1 Replies

2. Solaris

CPU/processor/cores in M4000

Hi Gurus Can someone help me in explaining the below outputs . psrinfo -p 4 /usr/sbin/psrinfo -pv The physical processor has 4 virtual processors (0-3) SPARC64-VI (portid 1024 impl 0x6 ver 0x93 clock 2150 MHz) The physical processor has 4 virtual processors (8-11) SPARC64-VI... (3 Replies)
Discussion started by: ningy
3 Replies

3. Solaris

Processor Set Query

I configured the the pset1 with 2 different ways 1. poolcfg -c 'create pset pset1 (uint pset.min = 5; uint pset.max = 5)' pset pset1 int pset.sys_id 1 boolean pset.default false uint pset.min 5 uint pset.max 5 string pset.units population uint pset.load 7 uint pset.size 5 string... (0 Replies)
Discussion started by: fugitive
0 Replies

4. UNIX for Dummies Questions & Answers

Restrict access to a set of people in a group

Hi, How can I restrict access to a set of people in a group on a directory? Ex.. The following are the permissions on a directory (dir1) rwxrwxr-- own1 grp1 dir1 where own1 is the owner grp1 is the group name and dir1 is the directory name. So., Is there any way that only few id's in... (0 Replies)
Discussion started by: brahmi
0 Replies

5. Solaris

How to Destroy a processor set i.e pset

First of all I'm new to solaris. Today is the first day i'm practicing zones. In global zone i have created a two separate pools of 2CPU's and created a email-zone and a web-zone as given in a PDF. I deleted the 2 zones in the processor sets. How can i destroy the processor set and i want my... (2 Replies)
Discussion started by: breaker64
2 Replies

6. UNIX for Dummies Questions & Answers

How to set the name of the group and the owner while creation of the file?

How to set the name of the group and the owner while creation of the file? -rwxrwxr-x 1 root sys 1202 Dec 5 2002 abc.awk like here i need to set the name of root and sys to xxx xxx Any help is appreciated. Thanks. (2 Replies)
Discussion started by: nehak
2 Replies

7. UNIX for Dummies Questions & Answers

Cores on a processor

Hi All, What is the command to identify whether a processor is single core / dual core in solaris ? Thanks. (2 Replies)
Discussion started by: RAA
2 Replies

8. UNIX for Dummies Questions & Answers

Processor Affinity on Redhat AS3

Does anyone know how to setup processor affinity on Redhat AS3.0. I know how to do this on Solaris and Windows.. Thanks (2 Replies)
Discussion started by: sssow
2 Replies
Login or Register to Ask a Question