Mqueue blocking another process

Hi.

I’ve seen a strange behaviour between two QNX 6.2.1 nodes.

  • I’ve got a server process in one QNX node that provides messages on change.
  • One client, running in another node, registers to this server by sending it a request message.
  • This client has a queue (mqueue mechanism) and expects the data be written into the queue from the server.
  • The server should send the data to the client by using the client queue.

Where could be the problem if the client is blocked in a Reply state by the mqueue process in the other node?

It’s very wierd this behaviour, because the mqueue process is in Receive state (the good one for this process).

Thanks in advance
José

I don’t understand your question very well but here are some thoughts:

1:
Do an ‘ls -lR /dev/mqueue’ and see if your mqueue is filled.

If the mqueue is full (maximum number of messages received), then it is not possible to write to the mqueue anymore by the server.

Maybe you need to add O_NONBLOCK to mqopen (the writer).

2:
If the reader is REPLY blocked on the mqueue, then the mqueue is empty. As soon as there is data, the mqueue will unblock you by replying with data.

  1. If you want your client to return immidiately when there is data or not, use O_NONBLOCK. When there is no data, the returnvalue equeal -1 and errno is set to EAGAIN.

If this doesn’t help you, please reply and try to be a little more verbose.

Freddy