'Should mqueues be protected by semaphores

Should read mq_receive and write mq_send be protected by semaphores when accessing a queue in a multiprocess program or is there any sort of protection alredy built in



Solution 1:[1]

It's always recomended to read the formal documentation for API you are using.

Specifcally for mq_receive and mq_send these are:

In the atributes section you can see that both these functions are thread safe, meaning you can access them from multiple threads without additional protection.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wohlstad