[Well-Typed Blog] When "blocked indefinitely" is not indefinite

Consider a Haskell thread trying to read from a TMVar:

x <- atomically $ takeTMVar v

If the TMVar is currently empty and there are no other threads that could write to the TMVar, then this thread will never be able to make progress. The GHC runtime detects such situations, and this call to atomically will throw a BlockedIndefinitelyOnSTM exception, rendered as

thread blocked indefinitely in an STM transaction

Occasionally, however, the runtime will throw this exception even when progress is possible.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • modclub
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • everett
  • InstantRegret
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • anitta
  • kavyap
  • GTA5RPClips
  • cubers
  • JUstTest
  • osvaldo12
  • tacticalgear
  • Durango
  • khanakhh
  • ngwrru68w68
  • provamag3
  • Leos
  • tester
  • cisconetworking
  • ethstaker
  • megavids
  • normalnudes
  • lostlight
  • All magazines