Rust Threading Basics 🦀 Rust Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

ความคิดเห็น • 26

  • @a.lstudio4514
    @a.lstudio4514 ปีที่แล้ว +9

    The best rust course in the world, the ultimate in simplicity and explanation ❤

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว +2

      Thank you! I am doing my best to provide quality Rust learning materials. 🦀 Rust on! 🦀

  • @Gabriel_Bento
    @Gabriel_Bento 27 วันที่ผ่านมา

    I've always felt confused when it comes to threading, and why Rust is the way it is.With this video I could understand it better. Thanks Sullivan for the lesson, incredible work!

  • @ImranKhan-br5dv
    @ImranKhan-br5dv 7 หลายเดือนก่อน +2

    now i understand what is multithreading and the importance of this in rust

    • @TrevorSullivan
      @TrevorSullivan  7 หลายเดือนก่อน

      I'm so happy you're learning! Thank you

  • @AryungChen
    @AryungChen ปีที่แล้ว +1

    Awesome !! Is it possible to have a tutorial about RC, ARC, ...combine with thread or mutex scenarios/example?

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว +1

      Good idea!!! I will have to prioritize that topic

    • @AryungChen
      @AryungChen ปีที่แล้ว

      @@TrevorSullivan thank very much... It's so great for series of rust tutorial. Clear, basic and easy to understand.

  • @samzeng9918
    @samzeng9918 ปีที่แล้ว +2

    Excellent lessons,thanks for your work!

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว

      Thanks for joining me for the journey! 🦀Rust on!🦀

  • @ERAYKAAN850
    @ERAYKAAN850 ปีที่แล้ว +2

    i started with the course (i am at the 3. video) and i like it thanks! Can you please not stop doing this (: Could you explain ownership too?

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว

      Great topic! Yes, I will cover borrowing and ownership. 🙂

  • @Qwerty-of4ox
    @Qwerty-of4ox ปีที่แล้ว +2

    I have a doubt here. As you have shown the CPU usage, like 3 CPU Cores were completely utilised when running two spawned threads and a main thread. So my doubt is, is Rust doing multi-processing in the background? I mean spawned threads should be running in a single process / core right? unless you specify you want to do multi-processing? So running each thread in a separate core makes it multi-processing right? I mean in Python when I try multi-threading it does create multiple threads but all of them run in a single CPU core, unless I bring the multi-processing
    By the loving the series. Hoping more videos especially on Tokio, Actix and maybe some small Rust Projects using these crates.

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว +1

      Yes that's considered multi-processing! Rust is simply creating more threads. The operating system kernel is responsible for scheduling those threads on various CPU cores. One interesting thing you could explore is restricting a process to use specific CPU cores. On Linux systems, you'd use the "nice" utility to specify which CPU cores a process can use. On Windows, it's called "process affinity." Thanks for your question and kind comments!

  • @johnnielondon9840
    @johnnielondon9840 ปีที่แล้ว

    Really clear tutorial and style. Thanks for taking the time to publish all this content. A question - what extension are you using in VScode for syntax hinting? I’d like to try that. Thanks again!

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว

      Thank you so much! I'm using the Rust Analyzer extension.

  • @MoaresOliveiradaSilva
    @MoaresOliveiradaSilva 2 หลายเดือนก่อน

    I wanted to see how to use the multiple threads to count the 500_000_000_000 together and ending quickly

  • @severgun
    @severgun 3 หลายเดือนก่อน

    why work for main thread was in loop? It should be out of it

  • @meka4996
    @meka4996 หลายเดือนก่อน

    Very nice. Thanks

    • @TrevorSullivan
      @TrevorSullivan  หลายเดือนก่อน

      @@meka4996 thanks for watching my channel! I'm glad you're learning Rust! 🦀

  • @VickyGYT
    @VickyGYT 7 หลายเดือนก่อน

    I must say Golang has much superior parallel and concurrency support

    • @Morbsel
      @Morbsel 6 หลายเดือนก่อน

      These are just the basics lol

  • @vikinggeorge7007
    @vikinggeorge7007 ปีที่แล้ว

    I know how threads work, but what's the difference between Tokio threads and Std threads?

    • @TrevorSullivan
      @TrevorSullivan  ปีที่แล้ว

      Threads are just threads. In Rust, building async functions requires having an "executor" to drive the async function calls (Futures) to completion. Tokio just makes it easy to run async in a multi-threaded context. You're more than welcome to create and manage threads yourself though. It just depends on what you're trying to accomplish.

  • @anjonsarker2374
    @anjonsarker2374 ปีที่แล้ว

    Brilliant