Rust: Spawn a Thread

Поделиться
HTML-код
  • Опубликовано: 15 дек 2024

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

  • @SpeckyYT
    @SpeckyYT Год назад +8

    Even the doggo is interested into threading

  • @job4753
    @job4753 Год назад +5

    Nice! Would love to see a deepdive into threading in Rust.
    Subbed incase you ever make one:)

  • @MrSpiftire
    @MrSpiftire Год назад +4

    Could you show an example where two treads are generating some output in parallel that are being stored somewhere by the main tread? Eg. divide some computation onto different treads and combining the result?

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

    Is it possible to share read-only references to some data with a thread? For example, you've read some data from a file, and then want to use multiple threads to process that same data in different ways.

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

      Yes. The most obvious way would be to wrap the data in an Arc (atomically reference counted).

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

    Concurrently doesn’t necessarily mean at same time or in parallel, and the 2 threads are sharing the same standard output.
    Can we have a more complex example where multi threading is really useful?

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

    In all Rust channels the examples are the same. OK, but could you please show the use cases of the threads?