[GHC] #12419: Scheduling bug with forkOS + MVar

GHC ghc-devs at haskell.org
Mon Aug 1 14:34:43 UTC 2016


#12419: Scheduling bug with forkOS + MVar
-------------------------------------+-------------------------------------
        Reporter:  luisgabriel       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.2
       Component:  Runtime System    |              Version:  8.0.1
      Resolution:                    |             Keywords:  forkOS;
                                     |  scheduler
Operating System:  Linux             |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2430
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by luisgabriel):

 Replying to [comment:3 simonmar]:
 > I found one bug, see Phab:D2430.  However, even after the patch the
 threadscope profiles don't look identical.  I don't think there is an
 actual problem, just that the program itself isn't very parallel - if you
 zoom in, there's lots of time in each thread where no work is being done.
 The difference in scheduling is due to the way that `forkOS` has to hand-
 shake with the new thread to get its `ThreadId`.

 Indeed. This example is not very good. I did not expect the profiles to
 look identical, but it seemed a bit odd to me having a large number of
 capabilities in idle.

 Nevertheless, I'm happy to see you identified a bug in the scheduler.
 Thank you very much for the quick fix! Feel free to close this ticket when
 the patch lands.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12419#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list