So we are going in the university just to mark attendance and pay the fee and getting education for free here. Thank you so much. lots of love from #NEPAL
🎯 Key Takeaways for quick navigation: 00:01 📚 Introduction to Fork System Call 02:03 🔄 Return Values of Fork System Call 03:34 🖨️ Demonstration of Fork with One Call 05:31 🌳 Multiple Fork Calls and Process Generation 08:08 📊 Summary and Key Takeaways Made with HARPA AI
🎯 Key points for quick navigation: 00:01 *🛠️ Introduction to Fork System Call* - Explanation of the fork system call for creating a child process. - Use of fork in the C programming context, creating a clone of the parent process. - Differences between creating a new process with fork and using threads. 02:03 *📜 Fork System Call Behavior and Return Values* - When a fork is invoked, it returns a value that indicates the process context (child, parent, or error). - Child process identified by zero, parent by a positive number. - Discussion on scenarios leading to failure (-1) and expected outcomes. 03:05 *🔄 Fork Execution Sequence* - Description of how multiple fork calls impact process executions. - Forking leads to multiple parallel "Hello" print outputs. - Example illustrating fork mechanism with two forks resulting in multiple processes. 06:02 *➗ Process Count with Multiple Forks* - Calculation of the total number of process prints and child processes. - Formula: 2^n total processes and 2^n - 1 child processes per n fork calls. - Emphasis on understanding "Hello" print count and process hierarchy. Made with HARPA AI
You're an savior honestly. I don't live in India and my hindi isn't the best but you still manage to do an amazing job. Thanks for making videos like this.
sir today i saw your lecture about fork and then after i solved a question of fork which is asked in 2019 .it was so simple that it took only few seconds .before that i was unable to solve this question.thank you sir for your amazing explanation.
This video is really really great sir. You are doing great work for us. It will be a great help if you start a series on Artificial Intelligence and software engg according to UGC NET new syllabus. I think many people will be grateful to you. Thank you in advance sir.
Gate smashers bhai sabse accha teacher hain class ka DBMS kuch samajh mein ata hi nhi tha aapke video dekh ne ke baad dbms ka concept pura samajh mein aya aisha padhate raho sir love you ❤❤❤ ❤
👏 HatsOff to you sirji ....4 years Ki Study me ye topic nahi samja but today I understand it very well...kash aap pehle milte... You are the Best teacher
now a days getting college degree is just a fun but getting knowledge from such teacher is fruitful 😛 keep going sir students like me need more content 😅😅
In the parent process, the value of pid after calling fork() will be the process ID (PID) of the newly created child process. The pid variable will contain the PID of the child process, allowing the parent process to identify and potentially interact with the child process using this PID.
@Sajib Saha But if fork() methods in if block returns +ve value it means they have created a child process, then there are 3 fork() statements executed, So what will be the answer now?
The answer would be 4, because fork() method return return both 0 and 1,one after another, then there will be 4 cases in if block 00, 01, 10, 11. In 2nd and 3rd condition fork() method creates a child process and execute printf statement one after one. And in last case when fork() methods will return 1, then the inner fork() method will create a child process and a parent process. Thus, 4 times printf statement will be executed.
@Sajib Saha But what about fork() in if block, as condition of if block is also a fork() method, whether the condition satisfies or not, fork() in condition parentheses will be executed, I am not talking about fork() just after if block, I am talking about fork() in the condition of if block
16 times 1 will be printed because the formula mentioned by sir is 2^n for how much time the program is executed . (2-1) ^ n for how many child processes created Watch the video to get full easy and easy explanation Thank you sir
Sir whatever you said was alright and you explained everything well but kindly tell us that what is practical importance of this call and when to use this . What will be the advantage of creating a child process ? In actual practise i dont think we will be required to do same thing n number of times. Thank you .
sir... 50k hone wala h SUBSCRIBERS. .....haha SILVER play button ke sath new chapter of UGC-NET ka start kar dena bcoz exam ki DATESHEET aa gaye h..PLZZZZZZZZZZZZZZ
In the starting part of the video you mentioned that child process is created when the parent is busy or not available to execute the process but in the latter part of the video you were teaching that both the child and parent process work simultaneously, then what is the need for creating child process?
Hii @Gate Smashers the video was good but you didn't tell why the fork system call is needed. Yes to create Child Process with the same capability as of parent but what kind of problem does fork system call solve?
fork() function is executing 4 times so total 2 to power 4= 16 process will create including main process all 16 process will execute printf("1") so 1 will print 16 times in output Ans (B) 16
Our education system needs more teachers like him!
exacly ..he teaches uh without any boredom .
Yes bro.
yes specially professors
Ok then Go ahead
Strongly agree !
So we are going in the university just to mark attendance and pay the fee and getting education for free here. Thank you so much. lots of love from #NEPAL
🎯 Key Takeaways for quick navigation:
00:01 📚 Introduction to Fork System Call
02:03 🔄 Return Values of Fork System Call
03:34 🖨️ Demonstration of Fork with One Call
05:31 🌳 Multiple Fork Calls and Process Generation
08:08 📊 Summary and Key Takeaways
Made with HARPA AI
ONE OF THE BEST TEACHER OUT THERE ❤️ ,VERY HONESTLY SPEAKING ,I DON'T USUALLY COMMENT ON A TH-cam VIDEO BUT SIR YOU TEACHES WITH SUCH EASE❤️❤️❤️❤️❤️❤️
English sudhaar amit you teaches nhi likhte gdhe
@@Shubham-ui5yy chill bro😂🙌
1) B
As n=a and a=4. so 2^4=16
2) A
if condition is satisfied and fork is one time. n=1. Therefore 2
🎯 Key points for quick navigation:
00:01 *🛠️ Introduction to Fork System Call*
- Explanation of the fork system call for creating a child process.
- Use of fork in the C programming context, creating a clone of the parent process.
- Differences between creating a new process with fork and using threads.
02:03 *📜 Fork System Call Behavior and Return Values*
- When a fork is invoked, it returns a value that indicates the process context (child, parent, or error).
- Child process identified by zero, parent by a positive number.
- Discussion on scenarios leading to failure (-1) and expected outcomes.
03:05 *🔄 Fork Execution Sequence*
- Description of how multiple fork calls impact process executions.
- Forking leads to multiple parallel "Hello" print outputs.
- Example illustrating fork mechanism with two forks resulting in multiple processes.
06:02 *➗ Process Count with Multiple Forks*
- Calculation of the total number of process prints and child processes.
- Formula: 2^n total processes and 2^n - 1 child processes per n fork calls.
- Emphasis on understanding "Hello" print count and process hierarchy.
Made with HARPA AI
You're an savior honestly. I don't live in India and my hindi isn't the best but you still manage to do an amazing job. Thanks for making videos like this.
For my dear friends, who is searching answer for 2nd question, there is a detailed explanation of this question in the next video of this playlist.
thanks bro :)
thenkss
tnx
ohh thanks bro ive been trying so hard
thanks bro
Best Explanations of fork() system call and numerical explanation.
Make Fork Tree and count the total number of nodes at last level! OR for 4 times a, it will be 2^4=16 times (15 Child Processes, 1 Parent Process).
Farishta hai ye bnda...
He has got countless number of blessings...
Live long sir ❤️🌹🧿
waheguru ji
MCQ Solution : th-cam.com/video/uMMvYLB4cys/w-d-xo.html
sir today i saw your lecture about fork and then after i solved a question of fork which is asked in 2019 .it was so simple that it took only few seconds .before that i was unable to solve this question.thank you sir for your amazing explanation.
What is the answer of 2nd question. Can you help me?
4@@manishbadgotra
@@67_rohitraj54 thankyou for helping
Really, Our Education system needs teacher like you...I Salute you Sir👏👏👏
For parent (ye to hoga hi) This line of yours reminds me the whole method of fork(). Thank you sir g.
Because of this type of teachers, I get inspiration to continue higher studies
Awesome.. Thank u sir. How could someone dislike such a wonderful session.. Really u r amazing
mein to sir ke teaching ka fan bante ja raha hun ....love from bottom of my heart
Sir u teach every topic with great enthusiasm. 👍👍👍👏👏
Sir Ur Way Of teaching is amazing ....May God bless u ....
Great teacher. Salute you from pakistan
Saandaar, jaandaar,Jabardast,jindabaad... gurudev ki jay.
Thank You.. Thank You Sir! You accepted my request on videos for Fork() system call. I am so grateful to you.
masha ALLAH well sir topic ap ny esy smjaya jesy mahkan hota hai
well explained Sir... We need teachers like you in out university that we are lacking now
Best education on youtube. With your education we can understand everything.
Answer (B) 16..
Tnx for clear explanation sir..thank u so much...😊😊
I think no one can forget the output of fork after such explanation.. Thanks a lot sir...
Thank you sir for this part.... I was waiting for this...
It's very important lecture for me thanku so much sir bht hi acha explain Kiya apne
Keep up the good work Sir👌thank u
Informative Video🙏🙏
This video is really really great sir. You are doing great work for us. It will be a great help if you start a series on Artificial Intelligence and software engg according to UGC NET new syllabus. I think many people will be grateful to you. Thank you in advance sir.
Gate smashers bhai sabse accha teacher hain class ka DBMS kuch samajh mein ata hi nhi tha aapke video dekh ne ke baad dbms ka concept pura samajh mein aya aisha padhate raho sir love you ❤❤❤ ❤
MashAllah
example de kr aap ne samjhaya , uske liye bahut bahut Thank you sir. Ab nahi bhulungi
9:53
child processes - 15
It will print 16 times
can you explain pls
@@khushal3418 with the formula....
2^4 -1 children and 1 parent
4 because loop runs 4 times
correct
hyy what is the ans for the 2nd question, i see no one has commented it?
@@yujibestboiit should be 2
Very good explanation sir.
Thank you very much sir. Lots of respect to you.
My concepts got clear by watching your video.
Searched everywhere to understand but couldn't.
Tysm.#
Sir I am the biggest fan of u. Sir I am a bca student.and I learn every course u provide like CN,OS,DBMS,
Forking amazing 🔥
👏 HatsOff to you sirji ....4 years Ki Study me ye topic nahi samja but today I understand it very well...kash aap pehle milte... You are the Best teacher
cant thank you enough... Have been struggling for this since two days. I could understand this perfectly. Thank you so much
@Vasudha Pasumarthi can you tell from where are you preparing for DEC?
sir gajab padhate hai ....
every topic crystal clear 😍
now a days getting college degree is just a fun but getting knowledge from such teacher is fruitful 😛
keep going sir
students like me need more content 😅😅
good explanation :)
Wow! U have explained the concept in such an amazing manner. Thank you 😊
Besttt🎉🎉🎉🎉
In the parent process, the value of pid after calling fork() will be the process ID (PID) of the newly created child process. The pid variable will contain the PID of the child process, allowing the parent process to identify and potentially interact with the child process using this PID.
best engineering channel on youtube.great sir g
4 times loop run so 4 times fork command executed and result comes out to be 16 option(b)
Wrong
@@yash.gupta_ so what's the answer man
@@subscribeinsteadlike2768 30
@@voidofficial6525 you are wrong answer is 16 bro
@@prathamgupta6973 ANSWER IS 16 AS THE FOR LOOP WILL RUN 4 TIME FROM 1 TO 4 SO 4 TIMES AND 2^4 =16 SHOULD BE THE ANSWER.
1. 16 correct
2. 2 is correct
Thank you so much sir for provide such kind of contents 😊😊
1 is correct but i doubt the second one. some are saying 4 is the answer of 2nd question
I think it will 2
AOA guys I am from Pakistan, he is one of the best and my favorite teacher,,.
Q1 : 16 times Print 1
Q2 : 4 Times Print Hello
Can you please explain Q2's answer
Pls explain Q2... I beg 😭😭😭😭😭😭😭😭😭😭😭😭
@@Arceus948 @Mrudula Rothe P -> {C1, P} -> {C2, C1, C3, P} Therfore, 1 Parent & 3 Child, So 4 Times "Hello" Will be Printed.
@@BhagyaRana ok thnx 😀👍🏻
Awsm teaching method ...... Grt job
ques 1: B
ques 2: A
Very useful vedio sir 🙏🙏👍👍
a goes from 1 to 4, so Total 4 times fork is called so "1" is printed 2^(4) = 16 times. There will be 15 child process and 1 parent process
right
Wrong
nice video! thank u sir
B-16 times "1" is printed
it will print "hello" 4 times.
p
/ \
(Fork()=0) c1 p(fork()=1)
/ \
c2 p
/ \
c3 p
:- c1+c2+c3+p = 4 times "hello"
Is this right?
YES
great teaching
sir obviously 16 becasuse of 2^4 here n=5 -1=4 from loop, 15= child and 1= parent
excellant sir...
16 and 4? Whatever be the answer, you're an awesome teacher! I'm a high-schooler and even I could understand this!
sahi ha bhai
pls explain ans of 2nd ques
@Sajib Saha But if fork() methods in if block returns +ve value it means they have created a child process, then there are 3 fork() statements executed, So what will be the answer now?
The answer would be 4, because fork() method return return both 0 and 1,one after another, then there will be 4 cases in if block 00, 01, 10, 11. In 2nd and 3rd condition fork() method creates a child process and execute printf statement one after one. And in last case when fork() methods will return 1, then the inner fork() method will create a child process and a parent process. Thus, 4 times printf statement will be executed.
@Sajib Saha But what about fork() in if block, as condition of if block is also a fork() method, whether the condition satisfies or not, fork() in condition parentheses will be executed, I am not talking about fork() just after if block, I am talking about fork() in the condition of if block
Great job
16 times 1 will be printed because the formula mentioned by sir is 2^n for how much time the program is executed .
(2-1) ^ n for how many child processes created
Watch the video to get full easy and easy explanation
Thank you sir
One of the best teacher in india 🇮🇳
Sir whatever you said was alright and you explained everything well but kindly tell us that what is practical importance of this call and when to use this . What will be the advantage of creating a child process ? In actual practise i dont think we will be required to do same thing n number of times. Thank you .
great explaination
Sir
Your way of teaching is awesome
I wish you to God fill your all desire
Sir can please provide me viedoes ipc mechanism
Thank you so much..lots of love and blessings
sir plz NET k liye b subjct wise videos provide kr dijiye according to the schedule u provided...
Very nice
Answer for the question at last is 2⁴=16 option B as loop rotates 4 times .
most respect from Pakistan
Syed tehzeeb Haider
16 times "1" will be printed (15 child nodes and 1 main node)
very good explanation
sir... 50k hone wala h SUBSCRIBERS. .....haha SILVER play button ke sath new chapter of UGC-NET ka start kar dena bcoz exam ki DATESHEET aa gaye h..PLZZZZZZZZZZZZZZ
Nice video sir
In the starting part of the video you mentioned that child process is created when the parent is busy or not available to execute the process but in the latter part of the video you were teaching that both the child and parent process work simultaneously, then what is the need for creating child process?
did you get the answer?
Thanks for sharing knowledge
Answer of question 1 asked in the end will be "option B" i.e. "16" (2^4 because loop will be executed 4 times)
Awesome!
Please make a video that how os interact with processor...
Sir Very best Explanation
Amazing explanation!! Maybe you could have mapped the fork to tree data structure and explained why it is 2^n.
Superb
love from Pakistan
Lots of love and blessings from INDIA
Great explanation ...
sir, does it make a difference if we write
main()
{
fork();
printf("HELLO");
fork();
}
it will not work, and will give output of (Hello Hello)
Very much helpful and easy to understand
answer the video question
Q1 -option(B) 16
Q2 -option(C) 4
please explain Question.1> how it is 16?
Question 1:16 times.
Question 2: 4 times
no ans is 5 times
@@madhughneasai7106 no only 2 times.
Great sir
Hii @Gate Smashers the video was good but you didn't tell why the fork system call is needed. Yes to create Child Process with the same capability as of parent but what kind of problem does fork system call solve?
Very nice🎉🎉🎉💯
fork() function is executing 4 times so total 2 to power 4= 16 process will create including main process
all 16 process will execute printf("1")
so 1 will print 16 times in output
Ans (B) 16
32. dwar diagram n will understand
Your teaching is awesome sir 👌👌
Make a series for "System Analysis & Design".
Excellent Explanation - Thanks "Keep on the good work".
I vote for this too
Nice sir aap Awesome hooo❤❤❤❤❤❤❤