C# multithreading 🧶

preview_player
Показать описание
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 🎼 :
===========================================================
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
===========================================================
Рекомендации по теме
Комментарии
Автор

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";


Thread thread1 = new Thread(() => CountDown("Timer #1"));
Thread thread2 = new Thread(() => CountUp("Timer #2"));

thread1.Start();
thread2.Start();

+ " 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 <= 10; i++)
{
Console.WriteLine("Timer #2 : " + i + " seconds");
Thread.Sleep(1000);
}
Console.WriteLine("Timer #2 is complete!");
}
}
}

BroCodez
Автор

Wow. This is clear, short and so easy to understand. No obnoxious music, just plain code and explanations. Thank you!

nico_qwer
Автор

Thank you for explaining this in a simple way, it's not easy to find this kind of stuff nowadays!

FollyH
Автор

I only can say: WOW, YOU EXPLANATION SKILL IS SECRET LEVEL!!! Thank you for your knowledge sharing.

sergioernestotostadosanche
Автор

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

ricardomartins
Автор

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 :)

AhmadEn-iuph
Автор

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!

Takayaki
Автор

WOW, this is the easiest example of Multi Threading I have seen online to date. Thank you this makes it so much easier to understand!

bartsworkshop
Автор

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.

seekpodcast
Автор

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.

MadeoStudios
Автор

Oh nice, 50 new videos! Thanks for all of the effort put into these videos

dixta
Автор

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!

guillaume
Автор

Bro you should really continue this channel. Your explanation is sooo good. C# videos of such quality are hard to find on youtube

devfaldu
Автор

Yo that's some slick explaining you did there ... thanks got the basic concept down thanks to you

kanekiken
Автор

Bro i like your style of explaining, no BS talking, straight to the point

loviljacob.
Автор

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.

aba
Автор

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...

syllight
Автор

I am glad to see you again!
yo you uploaded a lot of videos!

jkking
Автор

Great video, thank you for explaining this in a simple way. Keep it on!

linhquach
Автор

Thank you for your nice and clear explanation!!!

mamedaleskerov