hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.4K
active users

Never use Tokio mutexes. From a guide I'm in the middle of writing:

@rain yes, in general async sync primitives seem to be a sign of bugs. async state probably should only be held by one task or instead made into sync state. i have not deadlocked myself with sync primitives (in particular because of very limited critical section lengths) but i have dealt with async ones deadlocking which is also impossible to debug comparatively.

@rain I was also contemplating submitting a change to the tokio docs to stop suggesting parking_lot also, because the std mutex really is fine now for basically all use cases, and parking_lot may be only a slight improvement.

@leftpaddotpy Correct, the parking lot mutex should not be recommended because it doesn't do lock poisoning.