proxy pid..

Hi,
Suppose I have a main process - MAIN . This process spawns a new process
using the command
spawnl(P_NOWAIT,“A”,“A”,0)
Now I attach a proxy to “A” by doing a qnx_proxy_attach(…) in MAIN.
And I am going to trigger this proxy from MAIN.

But in “A” I need to know for some reason what the PID of the proxy
attached to “A” was.
How can I know the proxy of the PID attached to “A” by MAIN in “A”?
I have noticed that generally if i do a spawnl(…), followed by a
proxy_attach, then the pid of the proxy is PID_of_spawned_process +1.
But this is not always the case when the program runs for a long time…

Any help would be appreciated …
Thanks
Anup


ANUP B. KATAKE
Graduate Student,
Aerospace Engineering
Texas A & M University.

email: anup@tamu.edu


inn.qnx.com” <anup@tamu.edu> wrote in message
news:a9j5qu$bel$1@inn.qnx.com

Hi,
Suppose I have a main process - MAIN . This process spawns a new process
using the command
spawnl(P_NOWAIT,“A”,“A”,0)
Now I attach a proxy to “A” by doing a qnx_proxy_attach(…) in MAIN.
And I am going to trigger this proxy from MAIN.

But in “A” I need to know for some reason what the PID of the proxy
attached to “A” was.
How can I know the proxy of the PID attached to “A” by MAIN in “A”?

The two processes need to communication, via a file, pipe or most
prefereable
a SendMsg the proxy id.

I have noticed that generally if i do a spawnl(…), followed by a
proxy_attach, then the pid of the proxy is PID_of_spawned_process +1.
But this is not always the case when the program runs for a long time…

Any help would be appreciated …
Thanks
Anup


ANUP B. KATAKE
Graduate Student,
Aerospace Engineering
Texas A & M University.

email: > anup@tamu.edu


Mario Charest <goto@nothingness.com> wrote:

inn.qnx.com” <> anup@tamu.edu> > wrote in message
news:a9j5qu$bel$> 1@inn.qnx.com> …
Hi,
Suppose I have a main process - MAIN . This process spawns a new process
using the command
spawnl(P_NOWAIT,“A”,“A”,0)
Now I attach a proxy to “A” by doing a qnx_proxy_attach(…) in MAIN.
And I am going to trigger this proxy from MAIN.

But in “A” I need to know for some reason what the PID of the proxy
attached to “A” was.
How can I know the proxy of the PID attached to “A” by MAIN in “A”?

The two processes need to communication, via a file, pipe or most
prefereable
a SendMsg the proxy id.

by Send() in QNX4 (Next guy confused by QNX6 founded! It seems QNX4 will
be forgotten soon… Oh,…)

Andy

I have noticed that generally if i do a spawnl(…), followed by a
proxy_attach, then the pid of the proxy is PID_of_spawned_process +1.
But this is not always the case when the program runs for a long time…

Any help would be appreciated …
Thanks
Anup


ANUP B. KATAKE
Graduate Student,
Aerospace Engineering
Texas A & M University.

email: > anup@tamu.edu


inn.qnx.com <anup@tamu.edu> wrote:

Hi,
Suppose I have a main process - MAIN . This process spawns a new process
using the command
spawnl(P_NOWAIT,“A”,“A”,0)
Now I attach a proxy to “A” by doing a qnx_proxy_attach(…) in MAIN.

This is generally not a good idea – the person who is going to
receive the proxy should be the process attaching the proxy.

And I am going to trigger this proxy from MAIN.

But in “A” I need to know for some reason what the PID of the proxy
attached to “A” was.

This is part of the reason it is bad for someone to attach a proxy to
someone else. (Another part of the reason, is that doing it this way
can’t work in the networked case, that is, if “A” was spawned on a
different node of the network.)

“A” should attach the proxy, then send MAIN a message with the proxy-id
for MAIN to trigger. (This can work in the networked case, though it
requires a bit of extra work, including a qnx_proxy_rem_attach().)

How can I know the proxy of the PID attached to “A” by MAIN in “A”?

MAIN would have to tell “A” what it is. There is no “magic” way to
know it.

I have noticed that generally if i do a spawnl(…), followed by a
proxy_attach, then the pid of the proxy is PID_of_spawned_process +1.
But this is not always the case when the program runs for a long time…

In fact, this is NOT dependable at all, it just happens that is likely
to be the next free entry in the process table – but this involves race
conditions and stuff.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

<andy@microstep-mis.com> wrote in message
news:a9jr6k$ks6$1@charon.microstep-mis.sk

Mario Charest <> goto@nothingness.com> > wrote:

inn.qnx.com” <> anup@tamu.edu> > wrote in message
news:a9j5qu$bel$> 1@inn.qnx.com> …
Hi,
Suppose I have a main process - MAIN . This process spawns a new
process
using the command
spawnl(P_NOWAIT,“A”,“A”,0)
Now I attach a proxy to “A” by doing a qnx_proxy_attach(…) in MAIN.
And I am going to trigger this proxy from MAIN.

But in “A” I need to know for some reason what the PID of the proxy
attached to “A” was.
How can I know the proxy of the PID attached to “A” by MAIN in “A”?

The two processes need to communication, via a file, pipe or most
prefereable
a SendMsg the proxy id.

by Send() in QNX4 (Next guy confused by QNX6 founded! It seems QNX4 will
be forgotten soon… Oh,…)

LOL, QNX 6 is MsgSend not SendMsg, I actually was causious not to use
QNX6 name but got it wrong anyway :wink:


Andy

I have noticed that generally if i do a spawnl(…), followed by a
proxy_attach, then the pid of the proxy is PID_of_spawned_process +1.
But this is not always the case when the program runs for a long
time…

Any help would be appreciated …
Thanks
Anup


ANUP B. KATAKE
Graduate Student,
Aerospace Engineering
Texas A & M University.

email: > anup@tamu.edu



\