backendconcurrency
Keep critical sections short, but preserve the invariant
Anonymous
Holding a lock during slow I/O can block unrelated work. Releasing it before the I/O can be unsafe if shared state changes in between, though. First identify which state must stay consistent; then consider doing the I/O outside the lock and rechecking or updating state safely afterward.
0