It is Ok, but under high load (lots of CPUs, lots ...
# coroutines
e
It is Ok, but under high load (lots of CPUs, lots of ops)
ConcurrentHashMap
is better.
👍 1
v
elizarov: Will synchronized (mutex) {...} block a thread or will it prempt a coroutine
I am just being cautious not to block a coroutine
e
synchornized
blocks a thread. There is a
Mutex
for coroutines with suspending
lock
.
v
So it is bad to use
synchronized
stuff in coroutines then 😄
guess I would do an implementation with
Mutex
then 😛
e
It would be interesting to look at. The anecdotal practice so far is that you can always find a solution to a problem at hand that does not use any kind of mutex or synchronization.
v
Ya, I am already trying to see if there is a coroutine friendly dictionary implemented already. I once did it for C# making an LRU cache that was
Task
friendly. Hope I don't have to do it myself here.
e
What you need to be able to do with it?