1. 27 Aug, 2013 9 commits
    • parcs's avatar
      Make stdout and stderr line-buffered · e8d0dc7e
      parcs authored
      An unbuffered handle is very slow to output to and there doesn't seem to
      be any reason to have these handles unbuffered.
      e8d0dc7e
    • parcs's avatar
      db347943
    • parcs's avatar
      Binary: Make lazyGet more thread-safe · 25f8cc83
      parcs authored
      All values read lazily from the same BinHandle share the same mutable
      offset variable (_off_r). If two such lazy values are simultaneously
      evaluated, the two threads will step over each other when writing to
      _off_r.
      
      Fortunately, for BinMem handles, making lazyGet thread-safe is simple:
      just use a fresh off_r variable when deferring the call to getAt.
      
      For BinIO handles, a race condition still exists because IO handles
      contain their own mutable file pointer variable that gets clobbered in a
      similar way that _off_r would. But GHC doesn't use BinIO handles anywhere
      so this particular issue could be ignored for now.
      25f8cc83
    • parcs's avatar
      27d189a7
    • parcs's avatar
      SysTools: make various functions thread-safe · 74762a5c
      parcs authored
      74762a5c
    • parcs's avatar
      FastString: make the string table thread-safe · d295a944
      parcs authored
      While we're at it, consolidate duplicate code into a helper function and
      strictify a few arguments.
      d295a944
    • parcs's avatar
      TcRnMonad: make forkM thread-safe · b0a20f26
      parcs authored
      A forkM'd action cannot safely share a UniqSupply with its parent.
      
      [ Originally I resolved this issue in another way: by atomically
        updating env_us in newUnique/newUniqueSupply. But I think this
        (equivalent) change is more sensible. ]
      b0a20f26
    • parcs's avatar
      UniqSupply: make mkSplitUniqSupply thread-safe · 036910ad
      parcs authored
      unsafeInterleaveIO is used instead of unsafeDupableInterleaveIO because
      a mk_supply thunk that is simultaneously entered by two threads should
      evaluate to the same UniqSupply.
      
      The UniqSupply counter is now incremented atomically using the RTS's
      atomic_inc().
      
      To mitigate the extra overhead of unsafeInterleaveIO in the
      single-threaded compiler, noDuplicate# is changed to exit early when
      n_capabilities == 1.
      036910ad
    • thoughtpolice's avatar
      Properly externalise codegen identifiers (#8166) · 776cfe28
      thoughtpolice authored
      388e14e2 unfortunately broke a subtle invariant in the code generator:
      when generating code for an application, names may need to be
      externalised, in case you're building against something external with
      was built with -split-objs.
      
      We were never externalising the ids of the applied functions. This means
      if the libraries are split and we call into them, then the compiler
      won't may not generate correct ids when making references to functions
      in the library (causing linker failure).
      
      I'm not entirely sure how this didn't break everything, but it certainly
      caused several failures for a bunch of people. I had to fiddle with my
      tree a little to make this occur.
      
      This should fix #8166
      
      .
      Signed-off-by: thoughtpolice's avatarAustin Seipp <aseipp@pobox.com>
      776cfe28
  2. 26 Aug, 2013 1 commit
  3. 24 Aug, 2013 7 commits
  4. 23 Aug, 2013 8 commits
  5. 22 Aug, 2013 15 commits