Handling multiple messages in message queue
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I've done some research about this topic but I didn't understand it quite well.
From msgsnd man page
:
The msgsnd() system call appends a copy of the message pointed to by
msgp to the message queue whose identifier is specified by msqid.
Does this mean that when i use a msgget
to create a message queue the Enqueue and Dequeue happens automatically with msgsnd
and msgrcv
?
For example, if I want to use a message queue that can simultaneously hold N messages, when i use msgsnd
i put a message to the queue and when i use msg rcv
i get it from here and delete that message?
If that's the case i shouldn't implement manually enqueue and dequeue to create a list of N messages because it's enough to set a value to const void *msgp
from int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
to add one more message in the queue and it is enough that this is received by msgrcv
to be deleted from the queue otherwise it remains in the queue until it is received by some process, am i correct?
But then how much messages this queue can contain if i'm not the one setting how many can be contained?
ipc mqueue
add a comment |Â
up vote
0
down vote
favorite
I've done some research about this topic but I didn't understand it quite well.
From msgsnd man page
:
The msgsnd() system call appends a copy of the message pointed to by
msgp to the message queue whose identifier is specified by msqid.
Does this mean that when i use a msgget
to create a message queue the Enqueue and Dequeue happens automatically with msgsnd
and msgrcv
?
For example, if I want to use a message queue that can simultaneously hold N messages, when i use msgsnd
i put a message to the queue and when i use msg rcv
i get it from here and delete that message?
If that's the case i shouldn't implement manually enqueue and dequeue to create a list of N messages because it's enough to set a value to const void *msgp
from int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
to add one more message in the queue and it is enough that this is received by msgrcv
to be deleted from the queue otherwise it remains in the queue until it is received by some process, am i correct?
But then how much messages this queue can contain if i'm not the one setting how many can be contained?
ipc mqueue
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've done some research about this topic but I didn't understand it quite well.
From msgsnd man page
:
The msgsnd() system call appends a copy of the message pointed to by
msgp to the message queue whose identifier is specified by msqid.
Does this mean that when i use a msgget
to create a message queue the Enqueue and Dequeue happens automatically with msgsnd
and msgrcv
?
For example, if I want to use a message queue that can simultaneously hold N messages, when i use msgsnd
i put a message to the queue and when i use msg rcv
i get it from here and delete that message?
If that's the case i shouldn't implement manually enqueue and dequeue to create a list of N messages because it's enough to set a value to const void *msgp
from int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
to add one more message in the queue and it is enough that this is received by msgrcv
to be deleted from the queue otherwise it remains in the queue until it is received by some process, am i correct?
But then how much messages this queue can contain if i'm not the one setting how many can be contained?
ipc mqueue
I've done some research about this topic but I didn't understand it quite well.
From msgsnd man page
:
The msgsnd() system call appends a copy of the message pointed to by
msgp to the message queue whose identifier is specified by msqid.
Does this mean that when i use a msgget
to create a message queue the Enqueue and Dequeue happens automatically with msgsnd
and msgrcv
?
For example, if I want to use a message queue that can simultaneously hold N messages, when i use msgsnd
i put a message to the queue and when i use msg rcv
i get it from here and delete that message?
If that's the case i shouldn't implement manually enqueue and dequeue to create a list of N messages because it's enough to set a value to const void *msgp
from int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
to add one more message in the queue and it is enough that this is received by msgrcv
to be deleted from the queue otherwise it remains in the queue until it is received by some process, am i correct?
But then how much messages this queue can contain if i'm not the one setting how many can be contained?
ipc mqueue
asked Jan 4 at 14:55
Zeno Raiser
347
347
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
According to man2(msgrcv) enqueue/dequeue operations are handled internally by systemV API. so you don't need to re-implement them just use the provided API.
For message queue attributes use msgctl with IPC_INFO command.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
According to man2(msgrcv) enqueue/dequeue operations are handled internally by systemV API. so you don't need to re-implement them just use the provided API.
For message queue attributes use msgctl with IPC_INFO command.
add a comment |Â
up vote
1
down vote
accepted
According to man2(msgrcv) enqueue/dequeue operations are handled internally by systemV API. so you don't need to re-implement them just use the provided API.
For message queue attributes use msgctl with IPC_INFO command.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
According to man2(msgrcv) enqueue/dequeue operations are handled internally by systemV API. so you don't need to re-implement them just use the provided API.
For message queue attributes use msgctl with IPC_INFO command.
According to man2(msgrcv) enqueue/dequeue operations are handled internally by systemV API. so you don't need to re-implement them just use the provided API.
For message queue attributes use msgctl with IPC_INFO command.
answered Feb 22 at 11:02
SOFuser
511
511
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414790%2fhandling-multiple-messages-in-message-queue%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password