guava
guava copied to clipboard
Add possibility to create Striped lock with 'fair ordering policy' = true
I would like to use Striped with fair=true, I checked code and seems in current 19.0 version there is no way to do it.
I second this request. Maybe it would be good enough to just make the method
com.google.common.util.concurrent.Striped.lazy(int, Supplier<L>)
(and similar methods) public. Right now we are invoking that method via reflection to supply fair locks.
this ticket is still open?
Now that Guava gets released at a much shorter interval, I hope this ticket can be considered again :) In other words: Bump!
+1 for fairness.
Any update on this? It would be really useful to have fair locking
I put this on our agenda to discuss on Thursday.
We're going to add something that can be used for this (by adding Striped.custom
, similar to https://github.com/google/guava/issues/1893 (though that requested lazyWeakCustom
, which we aren't doing until we have a chance to look more into the lazy-weak use case)). We have another thing to add, too (Striped.intrinsicMonitors
), but I'll try not to let this sit too much longer.
Is it possible to bump this? I know the custom method exists now, but it's been package-private for an extended period of time. I'd love to use Striped, but the inability to use custom or even extend any of the sub-classes without having to resort to reflection is forcing me to implement my own.
Just for reference: https://github.com/google/guava/commit/d61375f7260e138e393822c2d1bda42a88419fc9#commitcomment-29941521
This would come in handy for Bazel. Would a PR that makes Striped#custom
public be welcome?
+1 on either supporting lock fainess or making Striped#custom
public.
We're going to add something that can be used for this (by adding
Striped.custom
, similar to #1893 (though that requestedlazyWeakCustom
, which we aren't doing until we have a chance to look more into the lazy-weak use case)). We have another thing to add, too (Striped.intrinsicMonitors
), but I'll try not to let this sit too much longer.
So, it's been sitting here for 5 years. Can we do anything to allow fairness?