C# multithreading 🧶
Vložit
- čas přidán 2. 07. 2021
- C# multithreading tutorial example explained
#C# #multithreading #threads
// thread = an execution path of a program
// We can use multiple threads to perform,
// different tasks of our program at the same time.
// Current thread running is "main" thread
// using System.Threading;
music credits 🎼 :
===========================================================
Up In My Jam (All Of A Sudden) by - Kubbi / kubbi
Creative Commons - Attribution-ShareAlike 3.0 Unported- CC BY-SA 3.0
Free Download / Stream: bit.ly/2JnDfCE
Music promoted by Audio Library • Up In My Jam (All Of A...
=========================================================== - Věda a technologie
using System;
using System.Threading;
namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
// thread = an execution path of a program
// We can use multiple threads to perform,
// different tasks of our program at the same time.
// Current thread running is "main" thread
// using System.Threading;
Thread mainThread = Thread.CurrentThread;
mainThread.Name = "Main Thread";
//Console.WriteLine(mainThread.Name);
Thread thread1 = new Thread(() => CountDown("Timer #1"));
Thread thread2 = new Thread(() => CountUp("Timer #2"));
thread1.Start();
thread2.Start();
Console.WriteLine(mainThread.Name + " is complete!");
Console.ReadKey();
}
public static void CountDown(String name)
{
for (int i = 10; i >= 0; i--)
{
Console.WriteLine("Timer #1 : " + i + " seconds");
Thread.Sleep(1000);
}
Console.WriteLine("Timer #1 is complete!");
}
public static void CountUp(String name)
{
for (int i = 0; i
Why are you uploading videos like this? Why don't make it a full course.
Hi! Could you make a video about topic "How to handle 2 keys pressed simultaneously in java"? Please... I'm Vietnamese and I'm really looking forward to this
@@agoogleuser3402 already
Beat YT alg !
Thank u❤
Wow. This is clear, short and so easy to understand. No obnoxious music, just plain code and explanations. Thank you!
Welcome adventurer! Seems like you've had a long way to get here (if you didn't skip any tutorial). Relax and be happy, because you just learned how to program in C# from the best teacher ever.
Seems like I have to go! I wish you luck on your next programming adventure.
Thank you for explaining this in a simple way, it's not easy to find this kind of stuff nowadays!
Thank you so much. I was trying to wrap my head around multithreading as used in Sebastian Lague’s procedurally generated terrain tutorial and this helped me a ton to understand what was going on.
first time I ran into your channel, you explainned in 6 min what my lecturer couldn't in 2 hours! you got a new subscriber, thank you
I only can say: WOW, YOU EXPLANATION SKILL IS SECRET LEVEL!!! Thank you for your knowledge sharing.
Hey Bro, keep up the good work. These 50 C# videos helped me a lot to get a grip on the language. Thank you so much!
Bro Code! So great this video. It goes straight to the point, in a very simple manner and explains clearly the difference between with and without multithreading. Thumbs up!
Oh nice, 50 new videos! Thanks for all of the effort put into these videos
Bro you should really continue this channel. Your explanation is sooo good. C# videos of such quality are hard to find on youtube
Completed all 50 videos. Thank you so much for the course. Your explanation and examples was very easy to understand. Thank you for all the amazing videos.
Yo that's some slick explaining you did there ... thanks got the basic concept down thanks to you
So easily explained, before this I thought of multithreading some tough concept but now the way you explained I will remember lifetime.
Thank you...
Your style of teaching is concise and clear. Wish you would also do more advanced c# topics and tutorials. I learned a lot from this. Thank you.
Since I got to know this channel, it has become my favorite channel when looking for comprehensive but concise and easy to understand programming courses!
Great channel. Great content. Great teaching style. Very concise and precise and straight to the point!
Thanks a lot for helping people learn to program :)
he also finished all the courses not like stopping after uploading a few videos like other youtuebers
OMG thank you, I've been trying to learn that async sh*t, but that wasn't what I was looking for. This was extremely, INSANELY, simple.
Simple and clear lessons.
Verry good!
Thanks.
Just subscribed. Two really great vids on topics I've been literally scouring the net for weeks. Just a fluke I've come across Bro Code. Keep up the excellent work!
Bro Code, ma bro. You've been cranking videos! I'm very happy for you and the other people who're gonna learn from you. I hope you got 8 hours of sleep though...
my man just spammed the upload button dayummmm .. now i have videos to binge all night
Thank you for your nice and clear explanation!!!
Just finished each one of his courses, so amazing!
Great, very helpful, thanks for sharing...
Thanks for this concise run through! :)
Great video, thank you for explaining this in a simple way. Keep it on!
Briliant tutorial, thank you!
I am glad to see you again!
yo you uploaded a lot of videos!
Thank you for this Bro! You are very clear and direct to the point, which makes the topics easy to understand
Liked, Subscribed, and Commented. You've earned it. You're great.
Thanks for sharing! Greetings from Brazil!
Nice explanation
Amo tus videos Bro!!! Espero puedas subir mas!!! Un abrazo desde Perú
Clear, simple, to the point. thanks!
Great explanation in a nutshell 👏👏
Thank you so much for explaining it so simple and easy to understand!
fantastic video series, thank you so much for your work!!!
Thank you so much, your tutorial help me to learn a lot of new things!
Thank you for explaining it very well. Was pulling hair all day to get a grasp about this topic.
really appreciating this channel. keep it nice and simple for us my bro.
Awesome work here.
Very nice! I 'm checking all other material in this channel. Thanks!
Awesome tutorial for beginners!
Thank you for the easy and quick lesson! :D
Thanks for the tutorial! It was nice and easy to understand!
Clear and simple. Thanks alot!
Thank you! This short clip helped alot!
Thank you very much. You helped me a lot with my project. I was needing a timer, running on the "background" and your tutorial helped me a lot! :)
I know it's been 6 months, but in case you haven't discovered it yet, you can use the DateTime type to compare a stored time value with the current time.
You helped me a lot.. the best tutorial out there.. thanksss
Nice example
This was perfect, thanks a lot!!!
Your videos are great! Many others could not help me, and despite the foreign language, I understood you perfectly
Great explanation! Thank you!!!
Amazing tutorial
Great video. Thanks for posting.
Simple and clear. Ty bro!
Thank you for this video, I am commenting to boost the algorithm and help your channel cuz im so cool like that fr fr. But thanks :D
you're amazing bro, nice video!
U ARE SO UNDERRATED FFS
Awesome! Saved me hours of study!
Thanks for all these videos they ar so helpful
Excellent! Thanks a lot.
Awesome🤩👍
Easy, fast and importantly clear 👍😎
Superb
Thank you, it was so helpful!!
nice explanation...
You are amazing. I really like your videos 👍🏻
Good video, quick and easy ! Thanks Bro !
jesus christ my abo box, good stuff.
Great video. Very useful.
it was good task. Congrulations Bro!
good explanation bro
Amazing! Please upload more C# Tutorials about real projects.
superb
well explained. Thanks.
great clear video thank
Well explained
Good one
If you ever feel lonely, remember we're your here for you, bro!
Thanks dude, great video
Short but crucial... A nice video
Nice Explanation. Thanks Bro :)
nice vedio.
Oh thank you!! ❤❤❤
great explanation bro!
Great job
Thank you so much bro!
Thanks for this 👍
Extremely useful!
very nice and simple way to make me clear : thanks Bro
Thank u my dood, very helpful video
To the point. Easy, peasy.
great video
thanks, this is very easy to understand
Thank you bro! At 5:00 it was what I was loking about. Thanks
you got a new subscriber.. thanks
Thank you!
Great video!
Thank you so much !