[GHC] #8623: Strange slowness when using async library with FFI callbacks

GHC ghc-devs at haskell.org
Sat Jan 11 21:27:54 UTC 2014


#8623: Strange slowness when using async library with FFI callbacks
--------------------------------------------+------------------------------
        Reporter:  JohnWiegley              |            Owner:  simonmar
            Type:  bug                      |           Status:  new
        Priority:  normal                   |        Milestone:  7.8.1
       Component:  Runtime System           |          Version:  7.6.3
      Resolution:                           |         Keywords:
Operating System:  MacOS X                  |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by simonmar):

 So I understand why this happens, but I don't have a good idea for what to
 do about it yet.

 The problem is that each call into the RTS from the C function is very
 short, and when it is complete. the next call creates a new thread that
 goes to the back of the run queue.  The main thread then gets a full time
 slice before the new thread gets to run.  You can see the effect with
 `+RTS -C0.1` which halves the time slice length and halves the time to run
 the program.

 The new thread goes to the back of the queue to avoid possible starvation
 of other threads in the queue.  Somehow we want to make the new thread
 inherit the rest of the timeslice from the previous thread, but I need to
 think some more about how we can do that.

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


More information about the ghc-tickets mailing list