Тёмный

Send is not about ownership by Alice Ryhl @ Copenhagen Rust Community 

Copenhagen Rust Community
Подписаться 1,4 тыс.
Просмотров 2,5 тыс.
50% 1

#rust #rustlang #programming
Talk by Alice Ryhl from the Tokio project.
Hosted at DIKU (University of Copenhagen) on the 28th of September 2023

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 9   
@LtdJorge
@LtdJorge 7 месяцев назад
14:05 is the key, for me
@aksh1618
@aksh1618 Месяц назад
I found this immensely helpful as someone going through the book and not completely understanding Send & Sync! Thanks for this unique perspective, great talk!
@ClearerThanMud
@ClearerThanMud 8 месяцев назад
This was helpful. Alice is a treasure to the Rust community; her posts on the Rust User Forum are great learning material.
@prabhat9274
@prabhat9274 10 месяцев назад
Great talk by alice, thank you so much cleared so many doubts about synchronization behaviour.
@yahavseligman4855
@yahavseligman4855 11 месяцев назад
Are those rules enforced by the compiler?
@johnsmith34
@johnsmith34 11 месяцев назад
Which rules?
@yahavseligman4855
@yahavseligman4855 11 месяцев назад
@@johnsmith34 the rules she talks about regarding "send" it reminds me of ownership rules but different thus I think thay can be an expansion to the ownership rules and the compiler should enforce those as well
@Zylellrenfar
@Zylellrenfar 11 месяцев назад
The compiler will automatically infer Send and Sync correctly for structs and enums on the assumption that no unsafe code depends on the content of those types. If you're using unsafe to write your own concurrent data structures / mutexes / etc, then it's not possible for the compiler to check the unsafe code in general. In some cases it should be possible to check these conditions with Miri, but not in the general case (and probably not efficiently either). As long as you're not writing unsafe code, you shouldn't have to worry about checking these rules, but understanding them is useful so that you know when you can use what types.
@ClearerThanMud
@ClearerThanMud 8 месяцев назад
The rules are all enforced, one way or the other, if that's what you're asking. AFAIK, the following things work together to provide this enforcement: 1. the borrow checker 2. trait bounds on certain functions/methods, e.g. ones that make a value visible to another thread 3. the compiler's rules for deciding whether a new type is Sync and/or Send, based on whether its component types are 4. the Sync and Send status of std types As usual, you can get around this in unsafe code, e.g. by providing an unsafe impl for Sync for a type, if you know what you are doing. But there be dragons.
Далее
Alice Ryhl - What it takes to keep Tokio running
20:28
Просмотров 4,3 тыс.
Qalpoq - Amakivachcha (hajviy ko'rsatuv)
41:44
Просмотров 437 тыс.
Keynote | Rust in the Linux kernel - Alice Ryhl
50:44
When to Choose Rust • Tim McNamara • YOW! 2022
56:14
JavaScript Visualized - Closures
11:34
Просмотров 41 тыс.
Rust embedded at Espressif @ Copenhagen Rust Community
45:16
5 traits your Rust types must implement
10:39
Просмотров 60 тыс.