Skip to content
  • Simon Marlow's avatar
    [project @ 2002-03-12 11:50:02 by simonmar] · f762be1b
    Simon Marlow authored
    Main threads are now not kept alive artificially, so it is possible
    for a main thread to be sent the BlockedOnDeadMVar exception.  Main
    threads are no longer GC roots.
    
    This involved cleaning up the weak pointer processing somewhat, and
    separating the processing of real weak pointers from the processing of
    the all_threads list (which can be thought of as "weaker pointers": a
    finalizer can keep a blocked thread alive, but not vice-versa).  The
    new story is described in a detailed comment in GC.c.
    
    One interesting consequence is that it's much harder to get a Deadlock
    exception now - many deadlock situations involving main threads will
    turn into BlockedOnDeadMVar situations instead.  For example, if there
    are a group of threads in a circular deadlock, then they will all be
    sent BlockedOnDeadMVar simultaneously, whereas before if one of them
    was the main thread it would be sent Deadlock.  It's really hard to
    get Deadlock now - you have to somehow keep an MVar independently
    reachable, eg. by using a StablePtr.
    f762be1b