You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apart from regular locking methods, coroutine's Mutex provides a selectable onLock method.
Selectable locking was added prior to version 1.0.0 for the sake of consistency and now adds more maintenance and public API burden than actual utility:
It cannot be used along with owner-based locking
It cannot be reliably aligned with similar synchronous primitives API, e.g. Semaphore
It obfuscated an API of Mutex-based primitives, such as ReadWriteMutex, where its read counter-part is cannot provide any selectable primitives
Its implementation, in a nutshell, relies on a code-heavy DCSS primitive, that implicitly increases the size of all Android applications that use Mutex in any way
As far as we know, it's neither used in our own coroutines-heavy internal codebases nor in any open-source projects and our research shows that it has no sane practical uses.
Thus the proposal is to deprecate it for removal in 1.6.0, deprecate with ERROR in 1.7.0 and, after further investigation, either remove it completely in 1.8.0 or provide a non-linearizable stub implementation and maintain it forever
The text was updated successfully, but these errors were encountered:
* Actually test 'onLock' and the corresponding concurrency and cancellation of Reactive's onSend
* Update benchmarks
* Non-linearizable implementation of PublisherCoroutine.onSend that isn't using Mutex.onLock
* Deprecate Mutex.onLock
FixesKotlin#2794
Co-authored-by: Dmitry Khalanskiy <Dmitry.Khalanskiy@jetbrains.com>
pablobaxter
pushed a commit
to pablobaxter/kotlinx.coroutines
that referenced
this issue
Sep 14, 2022
* Actually test 'onLock' and the corresponding concurrency and cancellation of Reactive's onSend
* Update benchmarks
* Non-linearizable implementation of PublisherCoroutine.onSend that isn't using Mutex.onLock
* Deprecate Mutex.onLock
FixesKotlin#2794
Co-authored-by: Dmitry Khalanskiy <Dmitry.Khalanskiy@jetbrains.com>
Apart from regular locking methods, coroutine's
Mutex
provides a selectableonLock
method.Selectable locking was added prior to version 1.0.0 for the sake of consistency and now adds more maintenance and public API burden than actual utility:
owner
-based lockingSemaphore
ReadWriteMutex
, where its read counter-part is cannot provide any selectable primitivesDCSS
primitive, that implicitly increases the size of all Android applications that useMutex
in any wayAs far as we know, it's neither used in our own coroutines-heavy internal codebases nor in any open-source projects and our research shows that it has no sane practical uses.
Thus the proposal is to deprecate it for removal in
1.6.0
, deprecate withERROR
in 1.7.0 and, after further investigation, either remove it completely in 1.8.0 or provide a non-linearizable stub implementation and maintain it foreverThe text was updated successfully, but these errors were encountered: