checking a process running on other node

I want to check wether a process on other qnet node is running or not.I use
two ways:
1, the process will be checked registers itself on the local nodes use the
function of name_attach,the node is running on node 1and its register name
is server,so other processes can use
open("/net/1/dev/name/local/server",O_RDONLY) to see if the process is
running.but the opening operation through the net is too slow,it will cost
ten or more seconds to return.

2,the server process creates a file named /tmp/server over the net,that
is,it creates the same file on each node of the net.so other processes
running on other nodes can check the server process by opening the local
file of /tmp/server.the problem is,after the server process which created
the file exited,the /tmp/server file on other nodes still exist,so,the other
processes can not response the exiting of server process.

I think my requirment is the best job the QNX can do.it’s almost my first
time programming qnx,so,can anybody help me?


best regards.

ChaoLi <xxs102@sohu.com> wrote:

I want to check wether a process on other qnet node is running or not.I use
two ways:
1, the process will be checked registers itself on the local nodes use the
function of name_attach,the node is running on node 1and its register name
is server,so other processes can use
open("/net/1/dev/name/local/server",O_RDONLY) to see if the process is
running.but the opening operation through the net is too slow,it will cost
ten or more seconds to return.

We need more information about this.

An “open” is an expensive operation, but 10 seconds seems way too
long for a ethernet connection.

What is the RTP version you have (uname -a) ?
Is it every open cost 10 seconds or only the first open ?
How do you start the QNET (do you using any command line option)?
If you do a “cp -V ./some_large_file /net/1/tmp/”, what speed you can
see ?
Is “cat /proc/qnetstats” show any retransmit ?
Is “nicinfo” show anything bad happened ?

-xtang

Thank you,Mr.Tang.The net is ok and it’s my fault.I put so many open()
functions in my programme and because I lack of the debuging skill so that
I felt it is the one opening operation wasted the time,now I know that the
time is the result of all opening operations.

Now I try to do UDP programming.But the parameters of the functions confused
me,can you help me once more?

I want to use UDP to have a packege broadcasting connectlessly .so,perhaps
the sendto () function is the only my choice.

the sendto is documented as that :

sendto( int s,cont void *msg,size_t len,int flags,const struct sockaddr
*to,size_t tolen);

if I want to have the broadcasting,so,what shall I value the s parameter?the
local socket or anyone else? what is the broadcasting port of the sockaddr
*to?if the *to are depended on my net ,how can I get the sockaddr *to?

Are there some source code of UDP programming or UDP documents can help me?

thank you.

best regards and happy weekend.

ChaoLi