Inter Process Communication QNX

I have a question about IPC in QNX. I have two processes:
One process reads data from a DAcard at a interupt frequency of 100 Hz.
The other process must read the data from the first process (a string of about 40 bytes) and send it via WLAN.
I have read about the IPC methods in QNX but I am not too familiar with it. So I would like to know wich one is the fastest most stable etc.

Hi Arend,

You might want to use a pulse to notify the client that data is available.

DAcard → write to /dev/shmem
DAcard → send pulse to reader
reader → on pulse, read fro shmem
reader → send over wlan

More about:
pulses → … 870_1.html


100Hz time 40 byte is 4ksec. Shouldn`t be a problem at all However expect huge jitter on wlan. Apparently with 6.2.1 and below qnet has problem over WLAN. You might want to use TCP/IP or use 6.3.

I would use a different architecture then fmartens

DAcard would be a resource manager. Data wouldn’t be in sharemem but made accessible via a read(). The reader could use ionotify() or select() to be informed of new data or simply have a thread that does blocks on read(). This makes the reader POSIX hence more portable. It’s more overhead then fmartens suggestion but a lot more flexible (you could use cat /dev/dacard) to spit out the data on the shell … It also mean the reader could access DACard via a network, hence the reader could be on a different machine.

I think I will use shared memory because this ies easier to implemented because I have not much time at the moment. But I have a still one question left. When I read from the shared memory is the data which is read than gone out of the shared memory or must I take care for that myself.

You need to take care of that yourself.

“which is read than gone out of the shared memory” , I don`t understand exactly what you mean.

Share memory is just like any other memory except it can be access by more then one process. Just imagine it as two C function accessing the same memory but possibly “at the same time”

A few pointers, you may need to protect the data with semaphores/mutex/locks/etc. While doing a read from one thread/process the data may becomes “inconsistent” if it`s also being written by another thread. Depending on the data is organized in memory (circular queue for example) you may be able to get away without using any sort of data protection method.