Message Passing With Rust MPSC Channels 🦀 Rust Tutorial

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

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

  • @Ch4h1d
    @Ch4h1d 3 หลายเดือนก่อน +2

    Im an embeddded dev trying to switch to rust..... love your vids

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

      @@Ch4h1d Rust is an amazing choice! 🦀 Thank you for your kind comment. 😊

  • @MartinBarton-f2u
    @MartinBarton-f2u 4 หลายเดือนก่อน +2

    Thank you for awesome tutorials it really helps me a lot !
    But I think there is a better way of demonstration. In your example (the final code) first you send 6 messages to the channel and after that you spawn the receiver thread. So you instantly receive all messages.
    If you move spawning of receiver thread before sending messages without .join() you will see desired "communication" better.

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

    i have never saw such easy and clean explaination for rust tutorial , Great to watch your content thanks

  • @ChidleyITCompute
    @ChidleyITCompute 8 หลายเดือนก่อน +2

    Concurrent and parallel programming is a key skill because computers can only boost their performance by adding more cores. This means that programmers need to know how to write code that can run on multiple cores simultaneously and efficiently. I think that rust is probably the best programming language for this. Thank you for these last few videos.

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

      Yes, Rust is an amazing language for performance! It's very efficient with CPU and memory resources. Thank you for your continued support! 😊❤️🦀

  • @jmsdnns
    @jmsdnns ปีที่แล้ว +3

    I have been watching all of your videos in the Rust series and just wanted to say that they're fantastic! I appreciate how much time you're putting in. I've been coding over 20 years, but I am new to Rust, so I appreciate very much that you are to the point and that you don't assume we're all beginner programmers. Thank you!

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

    Why do you not use if let Some / match patterns for the results? Or just pretty print the thing result?

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

      Personally I find the if..let syntax to be confusing. The match statement is growing on me a bit, so I do find myself using that more recently.

  • @roopeshsaravanan8609
    @roopeshsaravanan8609 10 หลายเดือนก่อน +2

    Could you provide the link to a github repo containing the code you wrote for the Rust playlist?

  • @sohansingh2022
    @sohansingh2022 3 หลายเดือนก่อน +1

    Beautiful!

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

    GREAT video (like the others); you're doing an amazing job with these tutorials.
    I must say: doing this in Go feels SUPER natural and smooth, and comparing the amount of work that needs to be done to achieve something similar in Rust seems wayyyy more complicated and involved

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

      Thanks for your kind words!
      You're definitely right that not everything is straightforward in Rust, but it does give you granular control. The way that errors are handled in Rust and Go is also very different. Both languages have excellent performance, so it's a matter of picking the tool that works best for you! Rust on!! 🦀

  • @MattPlncht
    @MattPlncht 8 หลายเดือนก่อน +1

    Amazing video, thanks a lot for explaining this topic!

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

    Thanks for making this.

  • @davidlanday6102
    @davidlanday6102 5 หลายเดือนก่อน +2

    does rust make any guaruntees about channel / thread allocation? For example, can I ensure that when I spawn two threads that they are on the same cpu core?

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

      That's a good question. Is there any reason that you wouldn't trust the OS thread scheduler to handle this appropriately? Why are you wanting to manually manage thread affinity from your Rust application? Are you building an OS in Rust?

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

      I do see there's a crate called "core_affinity" that would be worth exploring.

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

      @@TrevorSullivan not making an OS, but core affinity could be useful in a heavy compute (HPC) type of application. I might be wrong, but on hpc systems (while they have a control plane to manage resources over a network connection) you might want to ensure that you are not oversubscribing your resources or that a process utilizes only a certain number of cores and threads etc…?

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

      @@TrevorSullivan oh nice! I will look at this. Thanks!

  • @GlobalYoung7
    @GlobalYoung7 8 หลายเดือนก่อน +2

    thank you

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

    Your content is awesome

  • @AhmedFalih-kj3tt
    @AhmedFalih-kj3tt ปีที่แล้ว +5

    I really enjoy your video… i have learnt how channels work and made me more confident to work with rust as js/ts programmer… my favourite thing is you provide simple explanations that i can understand and i love how you provide many situations that can help us… i really enjoy your videos.. thank you so much for that work… i hope you have discord so i can contact you ❤

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

      Thanks for your kind feedback, Ahmed! I'm glad you are making progress! I'm on Discord @pcgeek86.

    • @AhmedFalih-kj3tt
      @AhmedFalih-kj3tt ปีที่แล้ว

      How about Arc with Mutex