Is having a reentrant readwrite lock an anitpatter...
# coroutines
r
Is having a reentrant readwrite lock an anitpattern in a reactive stack? Does it make sense to wrap it into a coroutines?
a
There is no reentrant lock in coroutines right now. You should probably follow semaphore development.
r
I mean I’ve a component that contains a read/write lock and get’s called by a suspended function
a
Java reentrant lock is blocking. If you are using blocking io, you can use it, but you won't get benifits from coroutines. You should remember to use
Dispatchers.IO
though not to block the pool. If you are using NIO, you should try to rewrite your code to avoid the lock entirely, or use coroutines Mutex.
r
Good input, will look into that