Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - setting cpu affinity based on thread id?: (2 Items)
   
setting cpu affinity based on thread id?  
Hello,

QNX provides the following function to set the cpu affinity for the 
_calling_ thread:

ThreadCtl(_NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT, data)

Is there also a function to set the cpu affinity for a given thread (not 
necessarily the calling thread) based on a thread id? In other words, is 
there a function that provides similar functionality as the Linux 
function sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask)?

Christian


-- 
Christian Haack, Senior Software Engineer   Tel: +49-721-663 968-34

aicas GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt



Re: setting cpu affinity based on thread id?  
Hello Christian,

The slay utility is able to do just this, I've attached the setrunmask_remote function from the utility that permits you
 to set the CPU affinity for any pid/tid on any given node. Hope this helps. 

-Eric

> Hello,
> 
> QNX provides the following function to set the cpu affinity for the 
> _calling_ thread:
> 
> ThreadCtl(_NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT, data)
> 
> Is there also a function to set the cpu affinity for a given thread (not 
> necessarily the calling thread) based on a thread id? In other words, is 
> there a function that provides similar functionality as the Linux 
> function sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask)?
> 
> Christian
> 
> 
> -- 
> Christian Haack, Senior Software Engineer   Tel: +49-721-663 968-34
> 
> aicas GmbH
> Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
> http://www.aicas.com   * Tel: +49-721-663 968-0
> 
> USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
> Geschäftsführer: Dr. James J. Hunt
> 
> 
> 


Attachment: Text setrunmask_remote.txt 2.93 KB