When trying to implement a simple echo server with concurrent support on linux. Following approaches are used: Use pthread functions to create a pool of thread, and maintained in a linked list. It’s created on process start, and destroy on process termination. Main thread will accept request, and use a …
Tag: message-queue
POSIX message queue – Does it still exists after reboot?
On linux, wrote a simple program to create a POSIX message queue, and send a msg to it, after the process terminated, it seems the msg is still there. The questions are: Does the msg still there after reboot? If it exists, then it’s on disk, how did it guarantee the performance if it stores msg on disk …
Not able to open a message queue in read mode (mq_open())
I have a program which creates a message queue and send a message (with mq_send()) to this queue. then I try to open the same message queue to read the message from another process. But mq_open() returns -1. open_and_write_MQ.c This creates the MQ. Below program tries to read the same MQ. open_and_read_MQ.c C…
What are the disadvantages of Linux’s message queues?
I am working on a message queue used to communication among process on embedded Linux. I am wondering why I’m not using the message queues provided by Linux as following: msgctl, msgget msgrcv, msgsnd. instead of creating shared memory, and sync up with semaphore? What’s the disadvantage of using …
How to peek into a Linux (POSIX) message queue without removing an item?
I need to peek into a message queue without removing them. I will go ahead and remove the message queue item only if it complies to certain criteria. How to do this? Following are the APIs I know — but none seems support peeking. mq_close() — close a message queue mq_getattr() — get the current attributes of …
Message queue: msgsnd failed : Invalid argument
Can anyone please help me to point out as what is the error in my program? Thanks in advance, kingsmasher1 Output: msgsnd failed: Invalid argument Answer You do not have enough space in your buf.mtext (15 characters) for “This is a test message” (23 characters plust one more for a NUL terminator).…