Nnamdi Kohn <nnamdi.kohn@tu-bs.de> wrote:
if this process/thread is ready to receive messages (receive blocking
status) from an other process/thread.
Are there QNX operating system functions (in C) that help me figure out
the
existence and status of processes/threads?
You could look at pidin source at cvs.
where do I exactly find that source?
cvs.qnx.com
are there really NO C-functions to obtain the process/thread status in own
programs?
Not NO functions.
But, essentially, from the outside processes are logically a black
box – they provide some services to you, through interfaces, usually
message based – but you can’t tell if it has one thread inside or
15, and you’re not really supposed to be able to tell.
But, of course, for debugging purposes, you often have to look inside
your black boxes – that is why there are debug APIs that allow you
to do this – but they are intended for debugging, therefor they may
not be the most convenient way to do what you want. The pidin source
from cvs.qnx.com shows how IT looks inside processes to give you thread
listings.
Now, checking for the existence of processes is something that is more
expected. If you know the pid already – you can use something like
kill(pid, 0) to test for its existence. If you don’t know its pid –
then you get into location issues, how would you locate the pid in
the first place? Usually you need some sort of name resolution mechanism,
and QNX provides one – the pathname space. Processes that want to be
found, put a name in the pathname space, and process that want to find
them look for that name. There are two primary ways this is done –
resmgr_attach() by resource managers, found with open() or name_attach()
for non-resource managers, found by name_open().
In both case, if the person who has registered a name terminates, that
name will be removed from the pathname space – so checking for the
existence of their name can be used as a method of checking for the
existence of a process that provides such a service.
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.