I have a process that uses IPc. I have created a resmgr in a thread
that waits for messages to arrive. If I send a message from another
process, everything works fine. If I try to open(), then MsgSend() from
within the same process (different thread), the open fails with file not
found. Is it illegal to send a message to myself when using resmgr?
Thanks.
Gregor Brandt
Gregor Brandt <gbrandt@oerlikon.ca> wrote:
I have a process that uses IPc. I have created a resmgr in a thread
that waits for messages to arrive. If I send a message from another
process, everything works fine. If I try to open(), then MsgSend() from
within the same process (different thread), the open fails with file not
found. Is it illegal to send a message to myself when using resmgr?
Check lib reference, resmgr_attach(), flag _RESMGR_FLAG_SELF
-xtang
Gregor Brandt <gbrandt@oerlikon.ca> wrote:
I have a process that uses IPc. I have created a resmgr in a thread
that waits for messages to arrive. If I send a message from another
process, everything works fine. If I try to open(), then MsgSend() from
within the same process (different thread), the open fails with file not
found. Is it illegal to send a message to myself when using resmgr?
No, not illegal. To do an open() on yourself requires a special flag
as noted in the other response.
Do you really need/want open() behaviour and everything with it between
your threads in the resmgr, though? (That is, do you intend to use this
connection for reads/writes or similar fd behaviour.) You may also want
to take a look at message_connect() for getting a connection to yourself
and message_attach() for handling non IO messages.
-David
QNX Training Services
dagibbs@qnx.com