Multithreading Explained In Under Six Minutes

Поділитися
Вставка
  • Опубліковано 12 чер 2024
  • Multithreading can seem like black magic that only code magicians can understand. But it's not as complicated as it seems. In this video we'll go through some examples that should hopefully demystify multithreading.
    And I also some thoughts on how multithreading might affect Digital Combat Simulator in an upcoming update.
    Eagle Dynamics has shared some information about the coming performance enhancements in this newsletter:
    www.digitalcombatsimulator.co...
    Obligatory disclaimers:
    The presence of DOD Visual Information in this video does not constitute endorsement by the DOD or any of its departments. Any views expressed by the presenter are those of the presenter and do not represent the views of the DOD or any of its components.
  • Наука та технологія

КОМЕНТАРІ • 32

  • @Roxas13XIII
    @Roxas13XIII Рік тому +5

    Very nice. I remember during my computer architecture course going through this. What I found interesting was, at least in my class, there's no real concrete formula for finding where multithreading will be faster than using single threads. Sometimes the data is just not large enough to make a noticeable difference. It was pretty much guess and check.

    • @oddlyspecificmath
      @oddlyspecificmath 11 місяців тому +1

      I think you develop a _"hmm, probably worth trying"_ sense for it too. The javascript/browser Canvas is a good bet, e.g.; here, Workers can do their best to update data for the next AnimationFrame (itself async and best-effort 60fps), but if they miss an update time point, the main / interactive thread doesn't have to hang (as it would if you tried calling out from the AF) and the browser stays responsive. Games that work fine in one thread on current phones then work on the (numerous, and actually likely to be multicore) hand-me-down's that are still out there worldwide.

  • @radjenrampersad
    @radjenrampersad Рік тому +4

    This is the first time it is explained to me in a way even I understand,...thank you very much.

  • @GlorifiedPig
    @GlorifiedPig 10 місяців тому

    By far the best quick explanation of multithreading I've found, thanks!

  • @redtailpilot
    @redtailpilot Рік тому

    Enjoyed watching this and learning as I wait for the new DCS MT update to finish downloading! 😉Thanks👍🏾

  • @edimoulitsas
    @edimoulitsas Рік тому +5

    As always, very clear and to the point. Many thanks Mike

  • @JoshHarris88
    @JoshHarris88 Рік тому +1

    Fantastic simple lesson!

  • @Patr10
    @Patr10 Рік тому +1

    Thanks! Very clear explanation

  • @speed-of-heat
    @speed-of-heat Рік тому

    solid brief, many thanks

  • @mindassassinatetv5242
    @mindassassinatetv5242 Рік тому

    Wow I like your explanations.....thanks bro...

  • @takeoffwithjakesoft
    @takeoffwithjakesoft Рік тому +1

    As a software developer and DCS player, I approve this message.

  • @DerekSpeareDSD
    @DerekSpeareDSD Рік тому

    great explanation!

  • @Jon885
    @Jon885 Рік тому +1

    Thanks Mike! This is very informative. Also, where did you get that USAF MB-339 skin?!?!

    • @TheOpsCenterByMikeSolyom
      @TheOpsCenterByMikeSolyom  Рік тому +1

      It's one I made myself. Once I get some time to optimize it I'll post it up to the user files.

    • @Jon885
      @Jon885 Рік тому

      @@TheOpsCenterByMikeSolyom Great job! It looks great! I may need to try and make a Lackland one.

  • @jaynuck
    @jaynuck Рік тому

    Thank you!

  • @ricardostorck
    @ricardostorck Рік тому

    very nice vid!

  • @DLevasseur
    @DLevasseur Рік тому +1

    Would love to see the code with the sync thread

    • @TheOpsCenterByMikeSolyom
      @TheOpsCenterByMikeSolyom  Рік тому +2

      I took a quick screenshot of that part and posted it here: drive.google.com/file/d/1HnrBnjAUaVqzz0KVoQUXMV7Sx1Z1QG7g/view?usp=share_link

  • @nathanskupowski4726
    @nathanskupowski4726 7 місяців тому

    Is this something that happens automatically

  • @S3NTRY
    @S3NTRY Рік тому

    Great stuff, thanks Mike.
    Where are most advantages to be gained by this.
    I've been under the impression that the logic could be even further divided by things like e.g. pathing, and firing solutions for AI having their own threads, with results being handed back in a queued fashion.
    Am I out of my tree, or does that make sense?

    • @TheOpsCenterByMikeSolyom
      @TheOpsCenterByMikeSolyom  Рік тому

      There's no way for anyone who doesn't have access to the source know where the biggest gains can be had. But you are right that dividing up the threads further will provide additional gains.
      In one of the newsletters ED did say that the two thread split was just the first iteration and more would be coming later. Hopefully, we won't have to wait years to see it.

    • @S3NTRY
      @S3NTRY Рік тому

      @@TheOpsCenterByMikeSolyom fingers crossed, as ever 🤞

  • @nrosko
    @nrosko Рік тому

    what about multiple cores? is that something else entirely?

    • @altyee
      @altyee Рік тому +1

      Thread is a logical concept and Core is a physical/hardware concept. A thread is an ordered list of tasks created by a program, and a core is the actual worker to do the tasks. In multiple cores setup, each core will be assigned a bunch of threads to work on. If there is only one thread for the given program, only one core can work on it. To parallel the program, you will need to logically divide the tasks (into multiple threads), and physically have multiple workers (multiple core).

    • @Roxas13XIII
      @Roxas13XIII Рік тому

      Threads are part of cores. Each core has X amount of threads.

  • @colen4308
    @colen4308 8 місяців тому

    does that mean multicore cpus have been a waste because most of the time only one thread is doing the work?

    • @TheOpsCenterByMikeSolyom
      @TheOpsCenterByMikeSolyom  8 місяців тому +1

      It depends on the application. In a truly single threaded app, yes the extra cores would be sitting idle.
      But since a lot of this channel's viewers are into DCS, let's use that as an example. Before this year's "multithreading" patch DCS actually did some work done on a separate thread. You'll hear people refer to it as the "sound thread". Now it was still pretty easy to overwhelm the entire DCS process because so much work was done in one overloaded thread. But the "multithreading" patch helped to split up that one mega thread and spread that load around.
      So in the case of DCS it would not have been a waste to use a multicore processor. It's just that it didn't help very much before the "multithreading" patch.
      A lot of DirectX games can also get a minor benefit as well since DirectX does some very limited automatic multithreading. But for a significant boost you need a purpose built multithreaded application.
      Hope that helps.

    • @mYOwngUn
      @mYOwngUn 2 місяці тому

      ​​@@TheOpsCenterByMikeSolyomhow do you know all of these things together with all the rest of your knowledge? It's very impressive. Like im which field does one have to know abour radars, multi threading etc.

    • @TheOpsCenterByMikeSolyom
      @TheOpsCenterByMikeSolyom  2 місяці тому +1

      @@mYOwngUn I was a programmer in the USAF. That gave me the opportunity to see a lot of the neat things the Air Force has and then write software for it.

    • @mYOwngUn
      @mYOwngUn 2 місяці тому

      @@TheOpsCenterByMikeSolyom thats awesome! Thanks for letting me know

  • @alymikky97
    @alymikky97 3 місяці тому

    like and sub for the POE clip.