Handling multiple messages in message queue

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question
























    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?







    share|improve this question






















      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?







      share|improve this question












      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?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 4 at 14:55









      Zeno Raiser

      347




      347




















          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.






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            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






























            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.






            share|improve this answer
























              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.






              share|improve this answer






















                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 22 at 11:02









                SOFuser

                511




                511






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    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













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay