I suggest you ...

Alternate fairness property for ReaderWriterLockSlim

The documentation describes the fairness policy for ReaderWriterLockSlim and mentions that "Future versions of the .NET Framework may introduce new fairness policies." I would like to vote for an option to match that of ReaderWriterLock.

Specifically, I need essentially queue up the requests in order, once a write lock is granted, then all read locks block (no different from today), but, when the write lock is released then all pending read locks will be guaranteed to be granted (does not work that way in ReaderWriterLockSlim, but does in ReaderWriterLock). If a write lock is requested and blocks because all of the read locks have not been released yet, it will block (same as today) and any new read locks will block because there is a pending write lock, again does not work that way in ReaderWriterLockSlim, but does in ReaderWriterLock.

Thank you,
Jim

2 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Jim FosterJim Foster shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base