Skip navigation.
Home
The QNX Community Portal

View topic - launch a program in one core

launch a program in one core

For discussion of realtime and/or embedded programming.

launch a program in one core

Postby djidji » Tue Aug 23, 2016 2:00 pm

Hi,

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


Thanks,
djidji
Active Member
 
Posts: 22
Joined: Tue Jun 28, 2016 1:17 pm

Re: launch a program in one core

Postby nico04 » Tue Aug 23, 2016 2:08 pm

Does this link answer your request ? : http://www.qnx.com/developers/docs/660/ ... inity.html
nico04
Active Member
 
Posts: 79
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: launch a program in one core

Postby nico04 » Tue Aug 23, 2016 2:14 pm

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
nico04
Active Member
 
Posts: 79
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: launch a program in one core

Postby maschoen » Wed Aug 24, 2016 3:03 am

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.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: launch a program in one core

Postby djidji » Thu Sep 08, 2016 11:58 am

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.
djidji
Active Member
 
Posts: 22
Joined: Tue Jun 28, 2016 1:17 pm

Re: launch a program in one core

Postby djidji » Thu Sep 08, 2016 1:04 pm

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
djidji
Active Member
 
Posts: 22
Joined: Tue Jun 28, 2016 1:17 pm

Re: launch a program in one core

Postby nico04 » Fri Sep 09, 2016 7:10 am

The run mask has to be a 32 bits unsigned int, not 8 bits unsigned char.
nico04
Active Member
 
Posts: 79
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: launch a program in one core

Postby denkelly » Fri Sep 09, 2016 11:52 am

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 );
denkelly
Senior Member
 
Posts: 161
Joined: Sat Aug 02, 2008 3:27 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest