3 ms·
It is totally fine to use locking with virtual threads. Of course you don't need it if you don't have to restrict access to shared resources in the first place
by samus 2y ago
It is totally fine to use locking with virtual threads. Of course you don't need it if you don't have to restrict access to shared resources in the first place (for example a connection pool or a datastructure with internal invariants that have to be maintained) or if lockless alternatives are available.