Program for Inter-Process Communication using shared memory

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ต.ค. 2024

ความคิดเห็น • 55

  • @aninditasaha0307
    @aninditasaha0307 3 ปีที่แล้ว +17

    Excellent sir... Simplest... Yet serving the purpose...very helpful for students... Can you make video on message queues?

    • @dextutor
      @dextutor  3 ปีที่แล้ว +2

      Thanks a lot.. Will upload the video by next week

  • @tarunnaik3053
    @tarunnaik3053 ปีที่แล้ว +4

    You made the topics much much more simpler than they are actually sir.Great Explanation 🙇

  • @deletevil
    @deletevil 2 ปีที่แล้ว +5

    Great explanation sir! Sir very important thing you didn't tell us. How do we clear/purge the memory occupied by the shared_memory. The first program that was the sender-program had exited. Do we need to call a function from receiver-program to delete the shared_memory?

    • @dextutor
      @dextutor  2 ปีที่แล้ว +1

      Use memset() function

  • @dhanrajv7473
    @dhanrajv7473 10 หลายเดือนก่อน

    hello sir could you tell me how to make this as full duplex communication using shared memory .
    example it can take input from any 1/2nd process ,and it should receive in another process

  • @pythonforfree7297
    @pythonforfree7297 ปีที่แล้ว +1

    outstanding

  • @bestdeal3385
    @bestdeal3385 3 ปีที่แล้ว

    i guess this was the best explanation,thank you sir

    • @dextutor
      @dextutor  2 ปีที่แล้ว +1

      Thanks.. Keep sharing

  • @gayathriciddamsetty4826
    @gayathriciddamsetty4826 3 ปีที่แล้ว +1

    Nice explanation 👌. Thank you

  • @mazharkhaliq1971
    @mazharkhaliq1971 6 หลายเดือนก่อน +1

    Thanks for the video 👏👏👏

  • @ayeshaadhikari6123
    @ayeshaadhikari6123 3 ปีที่แล้ว +2

    Thank you so much sir :) really helpful

  • @gouravshaw6254
    @gouravshaw6254 ปีที่แล้ว +1

    Great explanation 👌👍

  • @Tom-fx9mk
    @Tom-fx9mk 2 ปีที่แล้ว

    How do I determine how much space I need to use for the second argument of shmget? The file I'll be having the processes write to will be in the shared memory. Is 1024 bytes too little in my case (since I'll be having up to 20 processes writing a sentence to the file several times)?

    • @dextutor
      @dextutor  2 ปีที่แล้ว

      Managing space is upto the programmer.. Not all 20 process will be writing at the same time.. So after one process writes some make sure the reader process reads it before another process overwrites it.. If you feel the space is less you can allocate more space..just change 1024 to any number you want

  • @kanunithu2048
    @kanunithu2048 3 ปีที่แล้ว +3

    Thanks a lot, sir

  • @leepakshiyadav1643
    @leepakshiyadav1643 2 ปีที่แล้ว +1

    Great explanation.Thanks :)

  • @vaibhavpallod1023
    @vaibhavpallod1023 3 ปีที่แล้ว +1

    Sir use OBS software for recording your videos has poor quality butttt.... your videos are alot informational so thank you so much !

    • @dextutor
      @dextutor  3 ปีที่แล้ว

      Quality issue in terms of audio or video?

    • @vaibhavpallod1023
      @vaibhavpallod1023 3 ปีที่แล้ว

      @@dextutor video

    • @dextutor
      @dextutor  3 ปีที่แล้ว +1

      Thanks for the suggestion..i will work on that.. Check the latest video on Message queues and share if it was better

    • @vaibhavpallod1023
      @vaibhavpallod1023 3 ปีที่แล้ว

      @@dextutor sure man

  • @prathapbillgates
    @prathapbillgates 3 ปีที่แล้ว +2

    Nice video. can you make IPC memory passing video?

    • @dextutor
      @dextutor  3 ปีที่แล้ว

      I guess u meant message queues.. The video will be up soon.. Till that time have a look at this link
      dextutor.com/program-for-ipc-using-message-queues/

  • @navneetkaurpopli2766
    @navneetkaurpopli2766 2 ปีที่แล้ว +1

    great lab. Thanks

  • @rabiulhasan4674
    @rabiulhasan4674 2 ปีที่แล้ว

    Can You Help Me This Program
    Design a program that including 2 sub processes,it receives standard input,through sharing memory,the father process transmits a serial of number(>=10 )to the sub processes,after the sub processes receive the interupt signal from the father process:
    1) one subprocess plus the numbers
    2)the other subprocess mulitple the numbers
    Then through the message queue send the result to the father process,and the father process printf the numbers.

    • @dextutor
      @dextutor  2 ปีที่แล้ว

      Hi.. All the requirements are covered in the videos.. I will list out broadly
      1. Create two sub(child processes) using fork
      2. Use shared memory to send the input to sub processes
      3. Perform individual Calculations
      4. Create message queue to send back the results to the parent process

  • @abhijitkumarsinha
    @abhijitkumarsinha ปีที่แล้ว

    why in the receiver program we got different address for shared memory .....it get attached to the same memory segment then it should give the same address

    • @dextutor
      @dextutor  ปีที่แล้ว +1

      Shmat returns the address where the process gets attached to memory segment, not the address of the memory segment. That's why it's different for both process

    • @abhijitkumarsinha
      @abhijitkumarsinha ปีที่แล้ว

      thanks sir@@dextutor

  • @nadakudurutejakanth8500
    @nadakudurutejakanth8500 11 หลายเดือนก่อน

    Supr sir ❤

  • @hxong4733
    @hxong4733 2 ปีที่แล้ว +1

    Thank you sir!

  • @chandinikm7129
    @chandinikm7129 ปีที่แล้ว

    I am getting different key value in reciver program...written code as same .

  • @chinnurpk3519
    @chinnurpk3519 11 หลายเดือนก่อน

    Why the address for shared memory changes for sender and receiver??

    • @dextutor
      @dextutor  11 หลายเดือนก่อน

      It is the address at which the process gets attached with shared segment. So it can not be same for sender and receiver

    • @chinnurpk3519
      @chinnurpk3519 11 หลายเดือนก่อน

      @@dextutor ok thanks for clarifying my doubt

  • @guidosalescalvano9862
    @guidosalescalvano9862 ปีที่แล้ว +1

    Did I miss something, or did you not deallocate the memory? How do you deallocate?

  • @agpskalaparipaadeex7077
    @agpskalaparipaadeex7077 3 ปีที่แล้ว

    is it possible When a process communicates with each other, the timestamp is recorded with +5 secs?

    • @dextutor
      @dextutor  3 ปีที่แล้ว

      Use strftime function to fetch the time of communication and then add any additional time you want

  • @ohm_chiluka
    @ohm_chiluka 11 หลายเดือนก่อน

    Getting an error for:
    error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
    18 | strcpy(shared_memory,buff); //data written to shared memory
    | ^~~~~~~~~~~~~
    | |
    | void*

    • @TonyStark-lb2rj
      @TonyStark-lb2rj หลายเดือนก่อน

      just typecast it like -> strcpy((char*)shared_memory,buff);

  • @rahulpawar811
    @rahulpawar811 2 ปีที่แล้ว

    In second program in output the first program data we written is not show.. segment fault message show

    • @dextutor
      @dextutor  2 ปีที่แล้ว

      Check your code again..

    • @rahulpawar811
      @rahulpawar811 2 ปีที่แล้ว

      @@dextutor I check but same problem.... even I copy program from your site ,same problem occurs

    • @dextutor
      @dextutor  2 ปีที่แล้ว

      Email me the snapshot of your programs

  • @rekhavaishnav1462
    @rekhavaishnav1462 3 ปีที่แล้ว

    Sir who to use Iostat command in wsl

  • @_LAKSHAWADHWANI
    @_LAKSHAWADHWANI 2 ปีที่แล้ว +1

    Thanks a lot! :)

  • @prashantkassa9162
    @prashantkassa9162 ปีที่แล้ว

    Where this shared memory created

  • @manjeetkapil1882
    @manjeetkapil1882 3 ปีที่แล้ว

    Thanks brother

    • @dextutor
      @dextutor  3 ปีที่แล้ว +1

      Welcome... Please share among your friends

  • @theazkaasmat6647
    @theazkaasmat6647 ปีที่แล้ว

    how to complie

  • @silvianair7423
    @silvianair7423 2 ปีที่แล้ว

    Can we turn this into a function???

    • @dextutor
      @dextutor  2 ปีที่แล้ว

      Yes, you can