Blocking a task indefinitely in the RTS
Phil Ruffwind
rf at rufflewind.com
Tue Jan 8 06:59:30 UTC 2019
Okay, I skimmed rts/Schedule.c and now see the problem you mentioned :(
> On the non-threaded runtime the timeslice case doesn't apply and you only
> have one capability, it will force a GC to try to revive some tasks, and if
> at the end of
> this the tasks are still blocked it will release one in order to attempt to
> proceed. In short, as far as I can tell I don't think it considers
> reach-ability at all, not for MVars.
Maybe that should be considered a false positive (bug) for the deadlock checker? Just because the Haskell runtime has a single thread, that doesn't imply the whole program is necessarily single-threaded (in the presence of foreign things). I'd think this is a legitimate use case for MVars.
More information about the ghc-devs
mailing list