Do not miss our Interview Question video series 30 Important C# Interview Questions : th-cam.com/video/BKynEBPqiIM/w-d-xo.html 25 Important ASP.NET Interview Questions : th-cam.com/video/pXmMdmJUC0g/w-d-xo.html 25 Angular Interview Questions : th-cam.com/video/-jeoyDJDsSM/w-d-xo.html 5 MSBI Interview Questions : th-cam.com/video/5E815aXAwYQ/w-d-xo.html
No, I'd say you got it right... The term "threaded application" pretty much implies "parallel" execution of those threads--as long as you assume the threads to be asynchronous. If they are synchronous, then one might argue that the first thread stops to wait for the second and therefore they aren't truly executing at the same time. But with only one core, you don't have much other choice. So while I can see his point, I think you have presented this in an accurate fashion. Thanks!
Well in the last part of the video..I can see 'The main application has exited' and below that 'Function1 is entered'...How it is possible...I mean as it reaches to the end of the main program first it shouldn't display the 'Function1 is entered' at all.... Is it because of the delay in writing/displaying to the console application (I mean thread reached first to 'Function1 is entered' and then 'The main application has exited' but display wise it looks opposite) or I am missing something....???
I don't think it matters whether or not the threads are foreground or background. As I understand it, that only affects the persistence of the spawned thread when the parent thread terminates...as you've shown in your demonstration. I got a lot of information from your video, so thanks again for posting it!
can you please describe the timing of thread sleep in this program. Means which function call's when after 4 sec as we see there are in function1 and function 2 calling sequence
S...Because, Parallel code execution concept revolves around the execution of code in multiple processors....But in case of single processor MultiThreding concept(as demonstarted here), the processor executes for a specific time the code in function 1 and function 2. What this implies is that, the processor executes the code in f1 and then for f2. When it is executing f2, f1 is not executed.So, this is not parallel code execution.
Hiee sir , in ur 1st example i've added IsBackground = true for both the function but Function1 and Function2 is still looping and executing after Main thread has ended. what m i doing wrong ? Thread obj1 = new Thread(Function1); Thread obj2 = new Thread(Function2); obj1.IsBackground = true; obj2.IsBackground = true; obj1.Start(); obj2.Start(); Console.WriteLine("Main application has ended"); Console.ReadKey();
+Saurabh Main thread hasn't ended after displaying its message on the console. It waits for your next command Console.ReadKey(); Delete that, start the app with Ctrl + F5 evth should be fine
when he had function 1 & 2 = parallel tasks when it was just function 1 and explaining foreground and background thread...i guess it technically could be both threaded tasks and parallel tasks (I would go more with threaded tasks since you could argue that there is only one thread)
sir i've question if we don't call thread.sleep() method in both Function1 and Function2 Method then what will happen and its mandatory that we must call sleep() in threading
Also background threads abruptly end when all foreground threads end. So none of the cleanups will be performed including any cleanup in the finally block. So if any cleanup is important, use foreground thread or implement some way to cleanup the background before ending last foreground thread.
Hindu is a religion... not a race. That's like saying "Great another Christian tutorial." He sounds Indian, but I could be wrong. Also he knows his shit that's clear, so I don't mind the accent. I'm not an ignorant American.
Do not miss our Interview Question video series
30 Important C# Interview Questions : th-cam.com/video/BKynEBPqiIM/w-d-xo.html
25 Important ASP.NET Interview Questions : th-cam.com/video/pXmMdmJUC0g/w-d-xo.html
25 Angular Interview Questions : th-cam.com/video/-jeoyDJDsSM/w-d-xo.html
5 MSBI Interview Questions : th-cam.com/video/5E815aXAwYQ/w-d-xo.html
Much better than my instructor. Short and to the point!
Excellent, simple and easy to remember tutorial. Best explanation I found so far. Thanks, keep your great job.
Thanks for the contribution to the C# community!
Small correction in this vedio : Background thread will live until the life time of last foreground thread belongs to that process.
No, I'd say you got it right... The term "threaded application" pretty much implies "parallel" execution of those threads--as long as you assume the threads to be asynchronous. If they are synchronous, then one might argue that the first thread stops to wait for the second and therefore they aren't truly executing at the same time. But with only one core, you don't have much other choice. So while I can see his point, I think you have presented this in an accurate fashion. Thanks!
Great video! It helped me better understand threading in C#. Thank you!
This is kept simple and straight forward to the point. Good one
This was an awesome demonstration of Thread. Totally realised, thx a lot. Very understandable.
Straight to the point and clearly explained. Awesome
Perfect for beginners in threading concept, great help
Hi, Your explanation is too good and i find it very informative and understandable just in one watch.Thanks.
very2 helpful for me to understand the Thread. Thanks dude for the video
This video helps me a lot. Thank you.
Great explanation, thanks for sharing
Excellent video. Thanks a lot.
after 12 years
Task - An opeartion
Thread - process a Task (or executes an operation)
Multithreading - process multiple task parallel
Well in the last part of the video..I can see 'The main application has exited' and below that 'Function1 is entered'...How it is possible...I mean as it reaches to the end of the main program first it shouldn't display the 'Function1 is entered' at all.... Is it because of the delay in writing/displaying to the console application (I mean thread reached first to 'Function1 is entered' and then 'The main application has exited' but display wise it looks opposite) or I am missing something....???
Excellent video, very informative. Thanks.
really good explanation on threading.. thnkz for the video.
greate.ur explaination s simple & clear.
Nice class !! Worth for listening
Great tutorial sir. Well done. It helped me a lot!
great learning.
Thank you for your videos they are very useful!
in the starting : sheeshap LOL
I realize diferent beetwen foreground & Backgroung Threads completly...
Thanks for your VERY helpful video !
Thank you! very easy to understand
Nicely explained
Much better explanation...Thanks. :)
beautifully demonstrated.. thank you alot..
I don't think it matters whether or not the threads are foreground or background. As I understand it, that only affects the persistence of the spawned thread when the parent thread terminates...as you've shown in your demonstration.
I got a lot of information from your video, so thanks again for posting it!
She is very sharp.
nicely explained.
Nice vid! You made this simple.
It's very clear and usefull
Great sharing!
Hi Sir,
Please make video on difference between Finalize vs Dispose in C#
great tutorial. more power.
nicely explained..👍
Nice, Thanks! Good one, greetings from Germany
wonderful ! it helps me a lot , Thank you very much .
can you please describe the timing of thread sleep in this program. Means which function call's when after 4 sec as we see there are in function1 and function 2 calling sequence
Thanks for your nice videos.
hello can you please upload video on multiple parallel http asynchronous programing using await when all
Thread means parallel execution? Is not it is time slicing or context switching
S...Because, Parallel code execution concept revolves around the execution of code in multiple processors....But in case of single processor MultiThreding concept(as demonstarted here), the processor executes for a specific time the code in function 1 and function 2. What this implies is that, the processor executes the code in f1 and then for f2. When it is executing f2, f1 is not executed.So, this is not parallel code execution.
Great tutorial!!!
Hiee sir , in ur 1st example i've added IsBackground = true for both the function but Function1 and Function2 is still looping and executing after Main thread has ended. what m i doing wrong ?
Thread obj1 = new Thread(Function1);
Thread obj2 = new Thread(Function2);
obj1.IsBackground = true;
obj2.IsBackground = true;
obj1.Start();
obj2.Start();
Console.WriteLine("Main application has ended");
Console.ReadKey();
+Saurabh Main thread hasn't ended after displaying its message on the console. It waits for your next command Console.ReadKey(); Delete that, start the app with Ctrl + F5 evth should be fine
good explanation. thanks
Sir,may i ask,how does threading differs with delegate chaining? Thank you in advance.
Does
Any one have a example of STA threads managing com object with form
And running other tasks on background threads
Great video.
Very good
when he had function 1 & 2 = parallel tasks
when it was just function 1 and explaining foreground and background thread...i guess it technically could be both threaded tasks and parallel tasks (I would go more with threaded tasks since you could argue that there is only one thread)
very usefull...
good video
When you run 2 different threads - will they run parallely in the same core processor or will they run on two different processors ?
+bipulabu For technical query please mail us at questpond@questpond.com
Awesome!
Nice 👍
Thanks great tutorial
Excellent..!
great video....
Very helpful thanks
nice one !!! thank you so much
Did i mix up ?
No
Good one
sir i've question if we don't call thread.sleep() method in both Function1 and Function2 Method then what will happen
and its mandatory that we must call sleep() in threading
No it,s not mandatory if u want to stop your thread for some time then you can invoke thread.Sleep() method
awesome....
so what is use of background thread
Nice one thanxxxxxxxxxxxxxxxxxxx
great video thanks>........
can u explain when to use forground and background ?
Use background for tasks that don't involve any user interaction.
Also background threads abruptly end when all foreground threads end. So none of the cleanups will be performed including any cleanup in the finally block. So if any cleanup is important, use foreground thread or implement some way to cleanup the background before ending last foreground thread.
Santosh Kulkarni Nice :) Thank you :)
Santosh Kulkarni Really good explanation.
sir please tell me threadstart delegate
Great vid, its like taking lessons from Frank Sinatra :D in other words.... thanks.
great. waoooh
Why? What is the difference?
you should not mix up the definition for threaded tasks and parallel tasks.
Great another Hindu tutorial
"She sharp"??
She Saanp
👩⚖️🐍
Hindu is a religion... not a race. That's like saying "Great another Christian tutorial." He sounds Indian, but I could be wrong. Also he knows his shit that's clear, so I don't mind the accent. I'm not an ignorant American.
in other words
control F FIRE!
Americans invented this shit dude
Qytgystsyysysghggyggyyytffhgĝhhuuyuyyyyyyyyyhhhu7ùĥ
add should. be stop..
in other words!