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?
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
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)?
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
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/
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.
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
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
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
Excellent sir... Simplest... Yet serving the purpose...very helpful for students... Can you make video on message queues?
Thanks a lot.. Will upload the video by next week
You made the topics much much more simpler than they are actually sir.Great Explanation 🙇
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?
Use memset() function
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
outstanding
i guess this was the best explanation,thank you sir
Thanks.. Keep sharing
Nice explanation 👌. Thank you
Thanks for the video 👏👏👏
Thank you so much sir :) really helpful
Great explanation 👌👍
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)?
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
Thanks a lot, sir
Great explanation.Thanks :)
Sir use OBS software for recording your videos has poor quality butttt.... your videos are alot informational so thank you so much !
Quality issue in terms of audio or video?
@@dextutor video
Thanks for the suggestion..i will work on that.. Check the latest video on Message queues and share if it was better
@@dextutor sure man
Nice video. can you make IPC memory passing video?
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/
great lab. Thanks
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.
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
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
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
thanks sir@@dextutor
Supr sir ❤
Thank you sir!
I am getting different key value in reciver program...written code as same .
Why the address for shared memory changes for sender and receiver??
It is the address at which the process gets attached with shared segment. So it can not be same for sender and receiver
@@dextutor ok thanks for clarifying my doubt
Did I miss something, or did you not deallocate the memory? How do you deallocate?
is it possible When a process communicates with each other, the timestamp is recorded with +5 secs?
Use strftime function to fetch the time of communication and then add any additional time you want
Getting an error for:
error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
18 | strcpy(shared_memory,buff); //data written to shared memory
| ^~~~~~~~~~~~~
| |
| void*
just typecast it like -> strcpy((char*)shared_memory,buff);
In second program in output the first program data we written is not show.. segment fault message show
Check your code again..
@@dextutor I check but same problem.... even I copy program from your site ,same problem occurs
Email me the snapshot of your programs
Sir who to use Iostat command in wsl
Thanks a lot! :)
Where this shared memory created
RAM
Thanks brother
Welcome... Please share among your friends
how to complie
gcc file_name.c
Can we turn this into a function???
Yes, you can