I am developing a server program that serves multiple clients by multiple child processes. I use only one System V message queue to communicate between parent process and child processes. Each process will wait for message with mtype equals to process ID. Each child process only communicate to parent process. In parent process, I call msgrcv with flag IPC_NOWAIT to prevent being blocked to process other stuffs. With 2 child processes, it works as expect, but when number of child processes increases, the issue will happen as follow:
So:
My system is Centos 7. The message has size of 300 bytes.
Code is not given. Best is to check return values of failure and refer manpage . On gdb you can single step through to get to point where child process fails to send message
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.