It's because anyone can find other simple examples and just redo them on youtube. I'm glad he is not a professor lol. did anyone understand what he did with the arguments he created and passed into execv(). lmao ignorants
@@Amir-tv4nn ah I see a triggered professor (or maybe a child of a professor). Either way, yeah we got it. He explains better than paid professors. Who are mostly slackers.
May be you are in a college which is in lower tier. Like in any other organizations, there are good professors employed in good tier 1 institutions as they are payed decently. As the institution level goes down, professor's skill also compromised. Better to study well, crack entrances and get in to top institutes.
Thank You! So, fork() function creates a duplicate copy of the same program with different process id. The process who calls fork() is called parent process while the newly created process with exactly same contents and different process is called child process. Whereas exec() function is called with some argument by an already existing process. It replaces the existing process with the one referenced in argument. So the whole process is replaced by another with same process id of the older process. In fork (), process id changes while in exec(), process id remains the same. Fork produces duplicate while exec replaces the program.
if exec() function replace the whole content of running program then why the frist printf line execute which is written before the exec() function call
@@prantobhoumik6586 After exec() is called with ex2 as argument then the whole ex2 program will be replaced from that line and the process will not return back to ex1 And Before exec() whatever is written will obviously will get executed
After listening my proffesor`s meaningless and not understandable 3 hour fork() and exec() lessons, this video brings me to the moon man. Totally understand in
1) fork() - create a duplicate and separate process - number of processes created eqaul to 2^n where n is the number of invocation of fork() 2) exec() - replace the entire process, including all threads, by the program pass to this call
You pass an vector environment that the new process can use. For example when the first process makes a calculation that you need the result of in the other process, you just pass the result inside that vector environment
printf("hello "); fork(); printf("world "); fork(); printf("bye "); fork(); how many times will bye be displayed if the program is executed ? ( someone please explain this que)
exec : execute a binary file and push arguments in. The stack
Fork : used to eat food
EXCELLENT EXPLANATION ( hello from national technical university of Athens - Greece)
hello from the University of Leeds - England
(guys write your universities here too =D )
Hello from the University of Texas Rio Grande Valley - United States!
Hello from the Pontifical Catholic University of Chile!
Hello from Centre for Advanced Computing, Pune, Indua
hlo from MITS
The Best Explanation for fork() and exec() I ever saw. Hats off Sir !!
Truee
Because of your c programming video today I have clear the 1st round of ZOHO... Really thank you sir
did you understand why he created the array of arguments and passed them into the function? lmao
@@Amir-tv4nn No... Still alot more helpful tutorial than what I was searching through though...
Sir it's🔥🔥🔥🔥..U are simply awesome..Why can't we find a professor like u in colleges???🙍🙍
Cuz clg profs are paid and hence no value.😅
.
I would love to pay my clg fees to NesoAcademy!😍
It's because anyone can find other simple examples and just redo them on youtube. I'm glad he is not a professor lol. did anyone understand what he did with the arguments he created and passed into execv(). lmao ignorants
@@Amir-tv4nn ah I see a triggered professor (or maybe a child of a professor). Either way, yeah we got it. He explains better than paid professors. Who are mostly slackers.
Same doubt
May be you are in a college which is in lower tier. Like in any other organizations, there are good professors employed in good tier 1 institutions as they are payed decently. As the institution level goes down, professor's skill also compromised. Better to study well, crack entrances and get in to top institutes.
Thank You!
So, fork() function creates a duplicate copy of the same program with different process id. The process who calls fork() is called parent process while the newly created process with exactly same contents and different process is called child process.
Whereas exec() function is called with some argument by an already existing process. It replaces the existing process with the one referenced in argument. So the whole process is replaced by another with same process id of the older process. In fork (), process id changes while in exec(), process id remains the same. Fork produces duplicate while exec replaces the program.
Yes fork and exec are the most used syscalls in unix .
You always use them the shell always use them
exec is to execute a binary file
if exec() function replace the whole content of running program then why the frist printf line execute which is written before the exec() function call
@@prantobhoumik6586
After exec() is called with ex2 as argument then the whole ex2 program will be replaced from that line and the process will not return back to ex1
And
Before exec() whatever is written will obviously will get executed
You are all I needed. Thank you for this insightful and well explained lesson about fork() and exec()
Thank you for the explaining why PID was printed two times !
After listening my proffesor`s meaningless and not understandable 3 hour fork() and exec() lessons, this video brings me to the moon man. Totally understand in
Thank you very much you're helping many computer science students get through college!!
hats off for showing thing practically ...really its redefining learning
I got full mark in the quiz cuz of you TYSM
My favorite explanation of fork and exec calls, thank you.
If my college professors explained programming concepts like you do, many students would finish their degrees instead of dropping out!
agree...💯
Very straight and clear explanation with simple example.
Thanks sir
with respect from NIT Calicut
Thank you for this great explanation.
you are EXPLAIN clearly than my teachers , Thanks a lot sir.
Thanks a lot, this is the best explanation of exec and fork that i found.
Awesome practical explanation.😇❤️
Could u help me in numerical?
@@rajbhardwaj2180 I will
I got this, lessons on my class created the fear on me !
Thank you !
Thank you ur explaining everything detaily
Thank you for your good and simple explanation.
I can't believe I finally got this
Very nice explanation ❤
best explanation ever.
thank you
super clear explanation
very clean instruction. Thank you
thank u sooooo much sir.....you are the best teaher ever
You are an amazing teacher.
Nicely explained
Thanks you are way better than my professor.
All time favorite @ neso academy ❤️
19:46 yesss, clear. 😊❤
Excellent explanation Thanks
Thank you for the superb explanation
Thank you sir. You are explaining every thing in a great way thank you very much.
The best video in the whole youtube...
1) fork()
- create a duplicate and separate process
- number of processes created eqaul to 2^n where n is the number of invocation of fork()
2) exec()
- replace the entire process, including all threads, by the program pass to this call
what are those quotes on the cow. Lowkey love it
amazing explanation
Excellent explanation sir
Tnk U so much for your awsome contents🤞🔥
(from IUST university of Iran;//)
goood job guys kudos to your content .....keep uploading informative videos
6:10 if you are using windows terminal , use ./a.exe
Thank you! great explanation
Sir i think 8times the execution of system calls takesplace sir(fork)....loved ur teaching sir
Neso Academy is doing a great JOB!!
amazing explanation you saved me
u saved my grade man, thank you
dear neso academy u just explained it so nicely
Great Video !!!
Thanks bro, it's very awesome 🥰
Excellent explanation!!!!!
woww... amazing explanation....
well explained
Thanks, this explanation was very clear! 😄
Good explanation.
What an explanation .
very informative lecture
Best explanation ...Thank u sirr👍
thanks alot bro, god bless you
Thank you.
In 3 fork() system call why after 6 times prints then enter press automatically and the 2 times prints
illustration with the mint terminal was extremely helpful. thanks for such great illustration
Awesome Explanation...!!!
What was the purpose of passing the args array to exec?
You pass an vector environment that the new process can use.
For example when the first process makes a calculation that you need the result of in the other process, you just pass the result inside that vector environment
Man, You are the best!
printf("hello
");
fork();
printf("world
");
fork();
printf("bye
");
fork();
how many times will bye be displayed if the program is executed ?
( someone please explain this que)
thank u !!! its too much very helpful😇
Thank you so much
8 because the fork() is based on 2^n;
Why we generally write shell program?? What is its need??
Great sir 👏
thank you very much sir for this video
This is really good
Quite useful as usual, many thanks sir!!
Very nice🙏🙏
What a hero
for normal fork() calls its 2^n, for loops its 2^((n+1))−1
I very well could be wrong, but does that not simplify to the same thing?
@@Mr.Rogers1337 it is different. For example: for n=3, 2^3=8 and 2^(3+1) - 1 = 16-1 = 15
Gotcha. Thanks for taking the time lol
Thnaks
Thankyou sir
Thank you great explanation!
can I get 1000 like buttons for one video so that when I click like button it should count it as 1k. , that's how this man teaches .
Awesome, thanks
Awesome videos! Thank you so much!
For child fork return "0" as process id
Thank you so much ❤️
Any idea about what is the use of args in the execv() function?
Best video
thanks it helped
good one
Thank you sir 🤗🤗🤗
Dam longer video then expected but it's better explained than expected XD
great explanation ...thank you sir
and how do i go back to ex1.c in that example?
Sooooooooooooooooooooooooooooooo goooooooooooooooooooooood!
thank you so much!
really good!
now I understand that shit after wasted 1 hr of my life. thanks bro