1. 27 Oct, 2015 1 commit
    • niteria's avatar
      Make it possible to have different UniqSupply strategies · 158d2a91
      niteria authored
      To get reproducible/deterministic builds, the way that the Uniques are
      assigned shouldn't matter. This allows to test for that.
      
      It add 2 new flags:
      
      * `-dinitial-unique`
      * `-dunique-increment`
      
      And by varying these you can get interesting effects:
      
      * `-dinitial-unique=0 -dunique-increment 1` - current sequential
        UniqSupply
      
      * `-dinitial-unique=16777215 -dunique-increment -1` - UniqSupply that
        generates in decreasing order
      
      * `-dinitial-unique=1 -dunique-increment PRIME` - where PRIME big enough
        to overflow often - nonsequential order
      
      I haven't proven the usefullness of the last one yet and it's the reason
      why we have to mask the bits with `0xFFFFFF` in `genSym`, so I can
      remove it if it becomes contentious.
      
      Test Plan: validate on harbormaster
      
      Reviewers: simonmar, austin, ezyang, bgamari
      
      Reviewed By: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1360
      
      GHC Trac Issues: #4012
      158d2a91
  2. 04 Sep, 2013 2 commits
  3. 27 Aug, 2013 1 commit
    • 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
  4. 17 May, 2013 1 commit