Redisson: Fair lock vs regular lock

Created on 22 Mar 2018  ·  3Comments  ·  Source: redisson/redisson

Hi,
Right now we are using regular lock in our system. I found out in the documentation there is also fair lock option.
I am trying to find in the documentation any explanation about performance of fair lock vs regular lock.
Is there any performance penalty? I mean is there a reason not so use fair lock always by default?

Thanks

question

All 3 comments

I would recommend to use fair lock only if lock acquisition order is really required. All waiting threads are queued and if some thread has died then Redisson waits its return for 5 seconds. For example, if 5 threads are died for some reason then delay will be 25 seconds.

I would recommend to use fair lock only if lock acquisition order is really required. All waiting threads are queued and if some thread has died then Redisson waits its return for 5 seconds. For example, if 5 threads are died for some reason then delay will be 25 seconds.

Great tips !

I would recommend to use fair lock only if lock acquisition order is really required. All waiting threads are queued and if some thread has died then Redisson waits its return for 5 seconds. For example, if 5 threads are died for some reason then delay will be 25 seconds.

Great tips !

Excellence

Was this page helpful?
0 / 5 - 0 ratings