#rustlang #programming #async #coding #codingtutorial I think many people greatly underrate threads in Rust, so in this video I'll talk about them.
Жүктеу.....
Пікірлер: 9
@TRINCHIKAКүн бұрын
Cool channel, useful information.
@rustwithoutrust
20 сағат бұрын
Glad to hear!
@cobbcoding6 күн бұрын
best rust channel on youtube
@rustwithoutrust
6 күн бұрын
fr fr
@griffinmartin63564 күн бұрын
uses rwlock and proceeds to only use the write portion of it. you should've grabbed a read first and checked if the number was larger. if it was then you grab a write and write to that number if it isn't then you never grab a write
@rustwithoutrust
4 күн бұрын
Right, that wasn't the cleanest way. Actually, thought about it 😅 Great you've noticed that! Edit: No, you actually can't do it, because you can't lock twice at the same time.
@kevz3351
3 күн бұрын
that wouldn’t work since it will cause data races, another thread could occupy it when you were going to grab a write.
@griffinmartin6356
3 күн бұрын
@@kevz3351 your right. in this case RwLock does not help
@rustwithoutrust
3 күн бұрын
@@kevz3351You guys are getting me confused now 🤔 Lemme see who's right later for myself.
Пікірлер: 9
Cool channel, useful information.
@rustwithoutrust
20 сағат бұрын
Glad to hear!
best rust channel on youtube
@rustwithoutrust
6 күн бұрын
fr fr
uses rwlock and proceeds to only use the write portion of it. you should've grabbed a read first and checked if the number was larger. if it was then you grab a write and write to that number if it isn't then you never grab a write
@rustwithoutrust
4 күн бұрын
Right, that wasn't the cleanest way. Actually, thought about it 😅 Great you've noticed that! Edit: No, you actually can't do it, because you can't lock twice at the same time.
@kevz3351
3 күн бұрын
that wouldn’t work since it will cause data races, another thread could occupy it when you were going to grab a write.
@griffinmartin6356
3 күн бұрын
@@kevz3351 your right. in this case RwLock does not help
@rustwithoutrust
3 күн бұрын
@@kevz3351You guys are getting me confused now 🤔 Lemme see who's right later for myself.