quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Any reasons the mutex is used in quinn-protocol ? Thx #1338

Closed Kiddinglife closed 2 years ago

Kiddinglife commented 2 years ago

Does the use of mutex in Quinn-protocol introduce any performance penalty? Also is it better to apply the mutex in Quinn?

Ralith commented 2 years ago

Compared to what? Quinn uses locks when it is necessary to do so, and does not when it isn't. If your code is single threaded anyway it will not have any impact.