I am writing to the message queue
if (msgsnd(q, &msg, sizeof(message), slaves_list[to]) == -1)
and reading
if (msgrcv(q, &msg, sizeof(message), id, 0) == -1)
but what if this queue is empty? How to check it? If I want nothing to execute the following statement in a loop
source share