basvandijk / concurrent-extra

Extra concurrency primitives
Other
17 stars 5 forks source link

ReadWriteLock.releaseRead: already released #8

Closed waldheinz closed 10 years ago

waldheinz commented 10 years ago

I've just been hit by the error message

ads: Control.Concurrent.ReadWriteLock.releaseRead: already released

This must be coming from my Store module. Because I'm only ever using the with* functions on the RWLock, I'd guess my usage should be safe and this message should never be seen, right? This happens using GHC 7.6.3 on 64-bit Linux.

Looking through the code my first idea was that the Int on the Read state might overflow, but while the load can be quite intense, I'm pretty sure I don't have that many parallel reads.

roelvandijk commented 10 years ago

You are right that this shouldn't occur when you only use the with* functions. I'll have to think about this. Also the fix for the fairness problem (issue #7) could influence this behaviour.

Do you think you can isolate the problem in a test case?

waldheinz commented 10 years ago

That was easier than suspected: https://gist.github.com/waldheinz/dfb56be1d9b19f24eafc

basvandijk commented 10 years ago

Fixed in 0.7.0.8.