Broken beyond repair: Control.Concurrent.SampleVar

Chris Kuklewicz haskell at
Sun Apr 12 10:42:02 EDT 2009

Bulat Ziganshin wrote:
> Hello ChrisK,
> Sunday, April 12, 2009, 4:18:44 PM, you wrote:
>>   The problem with the current behavior is that the writeSampleVar pretends to
>> know how many blocked reader threads are waiting on a value.  In reality these
>> blocked threads may have been killed.
> may be it's possible to add exception handling to the write operation?

A perfect fix would leave SampleVar's full behavior unchanged when there are no
exceptions.  This perfect fix does not exist.

I claim it is possible to create a fix that leaves the documented behavior
unchanged, but changes some of the actual detailed behavior.

One such fix is up at


More information about the Libraries mailing list