C# multithreading 🧶

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024
  • 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...
    ===========================================================

Комментарии • 293

  • @BroCodez
    @BroCodez  3 года назад +93

    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

    • @agoogleuser3402
      @agoogleuser3402 3 года назад +1

      Why are you uploading videos like this? Why don't make it a full course.

    • @girlkun7518
      @girlkun7518 3 года назад

      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

    • @dakar_84
      @dakar_84 3 года назад +1

      @@agoogleuser3402 already

    • @georgebogheanu2200
      @georgebogheanu2200 Год назад

      Beat YT alg !

    • @Tecwithjawad_bahi
      @Tecwithjawad_bahi Год назад

      Thank u❤

  • @nico_qwer1732
    @nico_qwer1732 2 года назад +52

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

  • @FollyH
    @FollyH 2 года назад +59

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

  • @sergioernestotostadosanche5700
    @sergioernestotostadosanche5700 2 года назад +20

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

  • @MadeoStudios
    @MadeoStudios 7 месяцев назад +7

    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.

  • @ricardomartins5851
    @ricardomartins5851 2 года назад +7

    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

  • @bl333sk
    @bl333sk 5 месяцев назад

    just learned C# thanks to you. A great journey is ahead!

  • @AhmadEn-iu5ph
    @AhmadEn-iu5ph 2 года назад +9

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

    • @mrcatpfp
      @mrcatpfp Год назад +2

      he also finished all the courses not like stopping after uploading a few videos like other youtuebers

  • @MoHaTa-u3f
    @MoHaTa-u3f Месяц назад

    3:35 that makes a lot of sense now! Basically, running code on the same thread means your program will execute the code from top to bottom, and only execute the bottom after finishing to top. Multithreading enables you to run two different programs/commands (like you said) at the same time without having to wait for each other

  • @devfaldu9216
    @devfaldu9216 2 года назад +6

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

  • @seekpodcast
    @seekpodcast 2 года назад +7

    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.

  • @bartsworkshop
    @bartsworkshop 4 месяца назад

    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!

  • @loviljacob.795
    @loviljacob.795 5 месяцев назад

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

  • @syllight9053
    @syllight9053 3 года назад +6

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

  • @Takayaki42
    @Takayaki42 3 года назад +5

    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!

  • @dixta
    @dixta 3 года назад +2

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

  • @akshatjain7178
    @akshatjain7178 3 года назад +2

    my man just spammed the upload button dayummmm .. now i have videos to binge all night

  • @hirenjethva6122
    @hirenjethva6122 Год назад

    So easily explained, before this I thought of multithreading some tough concept but now the way you explained I will remember lifetime.
    Thank you...

  • @guillaume8437
    @guillaume8437 2 года назад +2

    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!

  • @pyaewaye2928
    @pyaewaye2928 10 месяцев назад

    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.

  • @shwetachavan751
    @shwetachavan751 9 месяцев назад

    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.

  • @lostninza9844
    @lostninza9844 4 месяца назад

    im freaking love your series, i have watched c++ and c# now and i can say that i surely can start programming now!
    thank you bro :D

  • @aba22125
    @aba22125 3 года назад +1

    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.

  • @kanekiken6431
    @kanekiken6431 3 года назад +2

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

  • @GiveUpOrGetUp
    @GiveUpOrGetUp 2 года назад

    Thank you for explaining it very well. Was pulling hair all day to get a grasp about this topic.

  • @kristijanlazarev
    @kristijanlazarev 9 месяцев назад

    Just finished each one of his courses, so amazing!

  • @grantwilliams9838
    @grantwilliams9838 Год назад

    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!

  • @yipyiphooray339
    @yipyiphooray339 3 года назад +9

    U ARE SO UNDERRATED FFS

  • @jkking3213
    @jkking3213 3 года назад +1

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

  • @karlallanicsky
    @karlallanicsky Год назад +1

    Thank you for this Bro! You are very clear and direct to the point, which makes the topics easy to understand

  • @NotXeneonn
    @NotXeneonn Год назад

    This video made me learn in 6 minutes what my programming teacher made me learn in 2 weeks

  • @mamedaleskerov1507
    @mamedaleskerov1507 2 года назад +2

    Thank you for your nice and clear explanation!!!

  • @IvanIvanov-ig1zx
    @IvanIvanov-ig1zx Год назад

    Simple and clear lessons.
    Verry good!
    Thanks.

  • @monkeibusiness
    @monkeibusiness 3 года назад +12

    jesus christ my abo box, good stuff.

  • @syllight9053
    @syllight9053 3 года назад

    If you ever feel lonely, remember we're your here for you, bro!

  • @Ragundah
    @Ragundah 2 года назад

    Liked, Subscribed, and Commented. You've earned it. You're great.

  • @pastub
    @pastub 2 года назад

    Very nice! I 'm checking all other material in this channel. Thanks!

  • @dimitriskaitatzis9770
    @dimitriskaitatzis9770 Год назад

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

    • @TheDigitalZero
      @TheDigitalZero Год назад

      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.

  • @manyfailsonewin4352
    @manyfailsonewin4352 2 года назад

    really appreciating this channel. keep it nice and simple for us my bro.

  • @ghaxxx8883
    @ghaxxx8883 Год назад

    You helped me a lot.. the best tutorial out there.. thanksss

  • @user-gk9fn8pu1f
    @user-gk9fn8pu1f Год назад

    Thank you so much, your tutorial help me to learn a lot of new things!

  • @mccordinator
    @mccordinator 7 месяцев назад

    Thanks for this concise run through! :)

  • @jjherrera2b
    @jjherrera2b Год назад

    Great, very helpful, thanks for sharing...

  • @SidheKnight
    @SidheKnight 5 месяцев назад

    Thank you! You're very good at explaining.

  • @OnderCoskun-il8wj
    @OnderCoskun-il8wj 2 года назад

    it was good task. Congrulations Bro!

  • @MahmoudSaadawy
    @MahmoudSaadawy 2 года назад

    Amazing! Please upload more C# Tutorials about real projects.

  • @yasinmagan7116
    @yasinmagan7116 2 года назад

    Great explanation in a nutshell 👏👏

  • @sinvalfelisberto
    @sinvalfelisberto 2 года назад

    Thanks for sharing! Greetings from Brazil!

  • @linhquach8662
    @linhquach8662 2 года назад

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

  • @moisesreiter
    @moisesreiter 2 года назад +1

    Amo tus videos Bro!!! Espero puedas subir mas!!! Un abrazo desde Perú

  • @CarlosGomez-kb24
    @CarlosGomez-kb24 Год назад

    Thank you for the easy and quick lesson! :D

  • @karlopetrinic6623
    @karlopetrinic6623 Год назад +6

    Can you do Lambda Expressions also?

  • @drorgu102
    @drorgu102 5 месяцев назад

    Could you enlighten me about what happens with the main thread?
    What should I do with it? Should one of the timers run on it, or is it better to create a new thread for every timer?
    Additionally, where should Tasks be used, or are they not relevant?
    I used your video's examples to understand threads more clearly.

  • @ametist007
    @ametist007 9 месяцев назад

    Your videos are great! Many others could not help me, and despite the foreign language, I understood you perfectly

  • @vigneshkanna1636
    @vigneshkanna1636 Год назад +2

    Great work and it would be very much helpful if you could give an real time examples like were this could be used in an automation frame work or so.

  • @timmyla90
    @timmyla90 Год назад

    Thank you so much for explaining it so simple and easy to understand!

  • @Forshen
    @Forshen Год назад

    Clear, simple, to the point. thanks!

  • @pawloaspaja289
    @pawloaspaja289 2 года назад

    Thank you bro! At 5:00 it was what I was loking about. Thanks

  • @stefanstrauberg6645
    @stefanstrauberg6645 Год назад

    Easy, fast and importantly clear 👍😎

  • @dazaifromrussia
    @dazaifromrussia Год назад

    Very Simple way of explaining.

  • @JimboyLearn-mc2zr
    @JimboyLearn-mc2zr 6 месяцев назад

    OMG, clicking through all the indian videos till I finally find a proper english video about this topic...

  • @jonbakari1330
    @jonbakari1330 3 года назад +1

    many thanks, I like your english - much better as my

  • @pepf64
    @pepf64 18 дней назад

    I wish you made more c# tutorials on LinQ stuff and IEnumerables, etc.

  • @patrickmachado7525
    @patrickmachado7525 2 года назад

    Awesome! Saved me hours of study!

  • @adbanerjee9888
    @adbanerjee9888 4 месяца назад

    Absolutely fantastic.. Thank you!

  • @Stellanovum
    @Stellanovum 2 года назад

    Thanks for the tutorial! It was nice and easy to understand!

  • @stephanieezat-panah7750
    @stephanieezat-panah7750 3 месяца назад

    As always, excellent. thank you, Bro

  • @dineshezeikel2578
    @dineshezeikel2578 6 месяцев назад

    Nice explanation

  • @mythos03
    @mythos03 Год назад

    fantastic video series, thank you so much for your work!!!

  • @TheScorpionAly
    @TheScorpionAly 2 года назад

    Awesome tutorial for beginners!

  • @nikoing
    @nikoing 2 года назад

    Short but crucial... A nice video

  • @zypeth4634
    @zypeth4634 Год назад

    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

  • @anurag_droidev
    @anurag_droidev 3 года назад +1

    Thanks for all these videos they ar so helpful

  • @danyasklyanichenko817
    @danyasklyanichenko817 6 месяцев назад

    man, you are the best. Thank you for this tutorial😘

  • @jiriklokocka7371
    @jiriklokocka7371 8 месяцев назад

    Briliant tutorial, thank you!

  • @steirerdis
    @steirerdis 2 года назад

    Thank you! This short clip helped alot!

  • @linzer-mm1fj
    @linzer-mm1fj 2 года назад

    good explanation bro

  • @hamzarafi5387
    @hamzarafi5387 2 года назад

    EZ explaination of multithreading..GG boi

  • @rifatislamrakesh
    @rifatislamrakesh 2 года назад +1

    please add more tutorials. async await would be great for next topic !

  • @megahombre24
    @megahombre24 2 года назад +2

    This was perfect, thanks a lot!!!

  • @tech-zenth
    @tech-zenth Год назад

    Nice example

  • @Anuli-Edom
    @Anuli-Edom 8 месяцев назад

    Awesome work here.

  • @jimzoo5254
    @jimzoo5254 Год назад

    nice vedio.

  • @zdspider6778
    @zdspider6778 Год назад +1

    These were great. I speedran through the playlist at 1.75x in about 2-3 days or so.
    5:46 A video on lambda expressions would be great, yeah.

    • @darios5355
      @darios5355 Год назад

      I would love to see a video about the Lambda expressions too!

  • @davidcordero396
    @davidcordero396 Год назад

    Clear and simple. Thanks alot!

  • @kamalpoladov5531
    @kamalpoladov5531 2 года назад

    You are amazing. I really like your videos 👍🏻

  • @_gabrielzin_6862
    @_gabrielzin_6862 3 года назад

    you're amazing bro, nice video!

  • @linus3k
    @linus3k Год назад

    To the point. Easy, peasy.

  • @KhalidIbnWalid15
    @KhalidIbnWalid15 Год назад

    Very well explained. Thanks Bro 🙂. A video on C# lambda would be useful as I didn't understand the bit about () => Thread1("thread #1").

  • @Vijaykumar-yz5mt
    @Vijaykumar-yz5mt 2 года назад

    very nice and simple way to make me clear : thanks Bro

  • @imperadordogado6189
    @imperadordogado6189 2 года назад

    Simple and clear. Ty bro!

  • @khizerhussain7613
    @khizerhussain7613 2 года назад

    Amazing tutorial

  • @surajwagh3654
    @surajwagh3654 2 года назад

    Superb

  • @AlirezaR5
    @AlirezaR5 Год назад

    I wish you had more videos on C#

  • @jeffchungwailoong
    @jeffchungwailoong 3 года назад

    nice explanation...

  • @Raiamshepard
    @Raiamshepard 2 года назад +1

    LIKEEEEEE!!!😍🧡

  • @mohammadbaghervahedi1420
    @mohammadbaghervahedi1420 2 месяца назад

    Helpful tutorial 😇

  • @antischoker
    @antischoker 2 года назад

    Nice Explanation. Thanks Bro :)

  • @elaprendiz7208
    @elaprendiz7208 9 месяцев назад

    My english it's not good, but i can understand everything what you say. I want to see a video about Lambda expression. Thank you for yours videos.

  • @jorgesan7080
    @jorgesan7080 Год назад

    Good video, quick and easy ! Thanks Bro !