Re: [GHC] #13615: Nondeterminism in ‘pure’ function w/ parallel evaluation & memo combinators

GHC ghc-devs at haskell.org
Thu Jun 15 23:49:26 UTC 2017


#13615: Nondeterminism in ‘pure’ function w/ parallel evaluation & memo combinators
-------------------------------------+-------------------------------------
        Reporter:  pacak             |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by pacak):

 {{{
 runST = unsafeDupablePerformIO -- more or less
 }}}


 > `unsafeDupablePerformIO`: This version of `unsafePerformIO` is more
 efficient because it omits the check that the IO is only being performed
 by a single thread.

 Basically "not to be used in multiple threads, we really mean it, look at
 the name"

 > `par`: Indicates that it may be beneficial to evaluate the first
 argument in parallel with the second.

 Basically "do things in multiple threads".

 The problem is `unsafeDupablePerformIO` is hidden in a bunch of different
 places. HashMaps, ByteStrings, etc... `par` is less frequent but not used
 directly either but it's also out there.

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


More information about the ghc-tickets mailing list