From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1319401552.9644.YahooMailNeo@domain.hid> Date: Sun, 23 Oct 2011 13:25:52 -0700 (PDT) From: "haitaozhumail-disc@domain.hid" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1062241449-536289358-1319401552=:9644" Subject: [Xenomai-help] address spaces of real-time task and standard linux process Reply-To: "haitaozhumail-disc@domain.hid" List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "xenomai@xenomai.org" ---1062241449-536289358-1319401552=:9644 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi All,=0A=0ADo a standard Linux process and a real-time task (spawned by t= he standard Linux process with rt_task_create and rt_task_start ) share the= same address space? More specifically, I have a C++ program like this:=0A= =0AClass A{ =0A=0A//Definition of a class A=0A};=0A=0ART_TASK demo_task;=0A= =0A=A0void demo(void *arg){=0AA * pA =3D (A *)arg;=0A//Access the passed ob= ject via pA, e.g., pA->a...=0A=0A}=0A=0Aint main(){=0A...=0A=0A=A0 A *pA = =3D new A;=0A=A0 rt_task_create(&demo_task, "realtime_task", 0, 50, 0);=0A= =A0 rt_task_start(&demo_task, &demo, (void *)pA);=0A=0A=0A=A0 pause();=0A= =0A}=0A=0ACan the function demo() correctly access the object created in ma= in()? What if pA is a smart pointer defined in Boost library?=0A=0A=0AWith = Many Thanks,=0ATom=0A ---1062241449-536289358-1319401552=:9644 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi All,

Do a standard Linux process and a real-time task (spawned = by the standard Linux process with rt_task_create and rt_task_start ) share= the same address space? More specifically, I have a C++ program like this:=

Class A{
//Definition of a class A=
};

RT_TASK demo_task;

 void= demo(void *arg){
A * pA =3D (A *)arg;
//Access the pas= sed object via pA, e.g., pA->a...
}

int main(){
...
  A *pA =3D new A;
  rt_task_create(&demo_task, "realtime_task", 0, 50, 0);
&nbs= p; rt_task_start(&demo_task, &demo, (void *)pA);

=
  pause();
}

Can the function = demo() correctly access the object created in main()? What if pA is a smart= pointer defined in Boost library?


= With Many Thanks,
Tom
---1062241449-536289358-1319401552=:9644--