https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

elizarov

03/05/2017, 7:09 AM
It is Ok, but under high load (lots of CPUs, lots of ops)
ConcurrentHashMap
is better.
👍 1
v

v0ldem0rt

03/05/2017, 6:00 PM
elizarov: Will synchronized (mutex) {...} block a thread or will it prempt a coroutine
I am just being cautious not to block a coroutine
e

elizarov

03/05/2017, 6:44 PM
synchornized
blocks a thread. There is a
Mutex
for coroutines with suspending
lock
.
v

v0ldem0rt

03/05/2017, 8:23 PM
So it is bad to use
synchronized
stuff in coroutines then 😄
guess I would do an implementation with
Mutex
then 😛
e

elizarov

03/05/2017, 8:51 PM
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

v0ldem0rt

03/05/2017, 9:08 PM
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

elizarov

03/06/2017, 5:04 AM
What you need to be able to do with it?
3 Views