Program for Inter Process Communication using Message Queues || msgget || msgsnd || msgrcv || IPC

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 22

  • @nithishjh5251
    @nithishjh5251 3 роки тому +1

    Thanks a lot sir for helping.
    Your Teaching is superb.

  • @zhoualias5481
    @zhoualias5481 Рік тому +2

    This video is very nice, it help me to understand message queue!

  • @rrohith5202
    @rrohith5202 3 роки тому +1

    Sir, I don't know why but I'm unable to get the output for the second (recieve) program . I'm doing it on ubuntu in my windows os

    • @dextutor
      @dextutor  3 роки тому +2

      This will not work in WSL in windows ( the one which you are using) for this program you need a pure Linux environment

    • @shivanisrivastava6360
      @shivanisrivastava6360 2 роки тому

      @@dextutor Same problem, I am not getting output of second program.. I did on linux virtual box.. Receiver program is not responding, it is not receiving the message.. i checked all syntax.. from video and blog both.. please give solution...on how to run on virtual box linux/Ubuntu?

    • @dextutor
      @dextutor  2 роки тому

      Please share the command that you are using to run the programs..
      Also drop a mail at dextutor@gmail.com with snapshots ..

    • @athulu8655
      @athulu8655 2 роки тому

      @@shivanisrivastava6360 changing key_t to the same in both files helped

  • @srikanthreddy9330
    @srikanthreddy9330 Рік тому

    I am unable to send void* type data inside a structure and getting output as segmentation fault

  • @girikgarg1268
    @girikgarg1268 3 роки тому

    HI! Can you please tell me why do I need to create a structure to send the message when I am using message queues? I mean, there is no such requirement while sending messages using shared memory, then why do I require it here? Would be grateful if you reply :)

    • @dextutor
      @dextutor  3 роки тому +2

      Message queues send blocks of data from one process to another. Each block is considered to have a "type".
      Thus for each data block there will be two things: data and type. Ao, structure is the best way to define two values with an object

  • @madhurikabudaraju4378
    @madhurikabudaraju4378 3 роки тому

    hello sir, i tried executing this program in ubuntu app on my windows OS, it did not create any message queue, what could be the reason?

    • @dextutor
      @dextutor  3 роки тому

      Because WSL does not support SysV message queues

  • @woodseller1939
    @woodseller1939 Рік тому

    Just my 1 rupee opinion/comment & please take it FWIW.
    This is a good introductory program for new learners.
    In an real world programming scenario, like in a good software development company - in the mq_send.c file being shown in this youtube video, we should set the integer variable "running" to 0 if the msgget() system call fails. This will ensure that the program prints the error message related to Message Queue creation failure and does not even enter the "while(running)" loop. Otherwise the program will enter the while loop and all the messages obtained from the user input will never ever get sent to the receiver program.
    I do see that there is an exit(0) line when Message Queue creation is a failure in the mq_send.c source code file in your indicated website. Here too , the usage of "exit(0)" indicates a success in the execution of the program. But for this failure scenario we can use either a non-zero positive integer or a simpler "exit(EXIT_FAILURE)" to indicate the program suffered a failure.
    One more missing item is the return value for the main() function in mq_send.c file.This program should return an integer (indicating a success or failure) when it exits from the while() loop.

    • @dextutor
      @dextutor  Рік тому

      As you rightly pointed out its an introductory program for beginners, so the things are kept simple and minimal.

  • @samadeekshareddy7958
    @samadeekshareddy7958 3 роки тому

    sir, fgets means is it storing in a file?

    • @dextutor
      @dextutor  3 роки тому +1

      Not in file but in the variable named "buffer". Whatever data you input using keyboard will be saved in buffer and then we copy it from buffer using strcpy into some_text

    • @deekshareddysama9890
      @deekshareddysama9890 3 роки тому

      @@dextutor thank you sir

  • @nikhilkumar_2788
    @nikhilkumar_2788 7 місяців тому

    Hey great content,
    But please update your site
    I do not feel safe in going to your site through my office laptop

  • @ritikamahanta
    @ritikamahanta 3 роки тому

    Is this complete playlist of os ..

  • @aryantnigam2246
    @aryantnigam2246 3 роки тому

    Sir are you from lpu?