Skip navigation.
Home
The QNX Community Portal

View topic - launch a program in one core

Page 1 of 1

launch a program in one core

PostPosted: Tue Aug 23, 2016 2:00 pm
by djidji
Hi,

I need to launch a program in one core, how I can do it ?


Thanks,

Re: launch a program in one core

PostPosted: Tue Aug 23, 2016 2:08 pm
by nico04
Does this link answer your request ? : http://www.qnx.com/developers/docs/660/ ... inity.html

Re: launch a program in one core

PostPosted: Tue Aug 23, 2016 2:14 pm
by nico04
If you can't rebuild the process to run, use the "on" command : http://www.qnx.com/developers/docs/660/ ... 1_4_5_15_4

Re: launch a program in one core

PostPosted: Wed Aug 24, 2016 3:03 am
by maschoen
djidji wrote:Hi,
I need to launch a program in one core, how I can do it ?
Thanks,


I think you can also control this using the Adaptive Partitioning scheduler. That may be more than you want to deal with.

Re: launch a program in one core

PostPosted: Thu Sep 08, 2016 11:58 am
by djidji
nico04 wrote:If you can't rebuild the process to run, use the "on" command : http://www.qnx.com/developers/docs/660/ ... 1_4_5_15_4


Hi nico04,

I used this code to test my programm in first core and second core

Code: Select all
unsigned char u8_cpu_run_mask2 =2 ;
   ThreadCtl(_NTO_TCTL_RUNMASK, (void *) &u8_cpu_run_mask2);


the time of execution is not so much different, so I'm wondering how I can be sure that my programm was running in the core that I want.

Re: launch a program in one core

PostPosted: Thu Sep 08, 2016 1:04 pm
by djidji
I finaly find how to chek with QNX System profiler, with the timeline I noticed that the programm switch between the CPU 1 and 2, it don't work in the same core.

Image

Re: launch a program in one core

PostPosted: Fri Sep 09, 2016 7:10 am
by nico04
The run mask has to be a 32 bits unsigned int, not 8 bits unsigned char.

Re: launch a program in one core

PostPosted: Fri Sep 09, 2016 11:52 am
by denkelly
Not only is the mask 32-bits, but read the docs carefully. This is what works - no ampersand.

unsigned cpu_run_mask = 2 ;
ThreadCtl( _NTO_TCTL_RUNMASK, (void *)cpu_run_mask );