Skip to content
Advertisement

Tag: message-queue

Design of multi-threaded server in c

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 POSIX message queue to store accepted socket file descriptor. Threads

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 Compilation steps: execution steps: then run below program

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 this set of functions directly on a business embedded product? Answer

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). I’d say there’s a good chance that may

Advertisement