1. 21 Oct, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-10-21 14:02:17 by simonmar] · 03a9ff01
      simonmar authored
      Big re-hash of the threaded/SMP runtime
      This is a significant reworking of the threaded and SMP parts of
      the runtime.  There are two overall goals here:
        - To push down the scheduler lock, reducing contention and allowing
          more parts of the system to run without locks.  In particular,
          the scheduler does not require a lock any more in the common case.
        - To improve affinity, so that running Haskell threads stick to the
          same OS threads as much as possible.
      At this point we have the basic structure working, but there are some
      pieces missing.  I believe it's reasonably stable - the important
      parts of the testsuite pass in all the (normal,threaded,SMP) ways.
      In more detail:
        - Each capability now has a run queue, instead of one global run
          queue.  The Capability and Task APIs have been completely
          rewritten; see Capability.h and Task.h for the details.
        - Each capability has its own pool of worker Tasks.  Hence, Haskell
          threads on a Capability's run queue will run on the same worker
          Task(s).  As long as the OS is doing something reasonable, this
          should mean they usually stick to the same CPU.  Another way to
          look at this is that we're assuming each Capability is associated
          with a fixed CPU.
        - What used to be StgMainThread is now part of the Task structure.
          Every OS thread in the runtime has an associated Task, and it
          can ask for its current Task at any time with myTask().
        - removed RTS_SUPPORTS_THREADS symbol, use THREADED_RTS instead
          (it is now defined for SMP too).
        - The RtsAPI has had to change; we must explicitly pass a Capability
          around now.  The previous interface assumed some global state.
          SchedAPI has also changed a lot.
        - The OSThreads API now supports thread-local storage, used to
          implement myTask(), although it could be done more efficiently
          using gcc's __thread extension when available.
        - I've moved some POSIX-specific stuff into the posix subdirectory,
          moving in the direction of separating out platform-specific
        - lots of lock-debugging and assertions in the runtime.  In particular,
          when DEBUG is on, we catch multiple ACQUIRE_LOCK()s, and there is
          also an ASSERT_LOCK_HELD() call.
      What's missing so far:
        - I have almost certainly broken the Win32 build, will fix soon.
        - any kind of thread migration or load balancing.  This is high up
          the agenda, though.
        - various performance tweaks to do
        - throwTo and forkProcess still do not work in SMP mode
  2. 20 Oct, 2005 3 commits
    • simonmar's avatar
      [project @ 2005-10-20 14:00:36 by simonmar] · 63e8af08
      simonmar authored
      Column numbers in SrcLocs are now counted as the number of characters,
      rather than columns.  i.e. a tab always counts as 1.  This was
      necessary for communication with Visual Studio interfaces which expect
      character indices, but also it seems the majority of other compilers
      also do things this way.
      From: Krasimir Angelov <kr.angelov@gmail.com>
    • simonmar's avatar
      [project @ 2005-10-20 11:45:19 by simonmar] · 4f0f4342
      simonmar authored
      changes to exitScheduler(): instead of waiting for all the tasks to
      stop, which is unreasonable, we just wait for the run queue to drain.
      This is much quicker, but not ideal (see comments).
    • sof's avatar
      [project @ 2005-10-20 00:52:38 by sof] · c86b512d
      sof authored
      [mingw]delay flushing console buffer until last possible moment. Merge to STABLE
  3. 19 Oct, 2005 1 commit
    • sof's avatar
      [project @ 2005-10-19 16:04:38 by sof] · 3d8a0867
      sof authored
      ocGetNames_PEi386(): correctly allocate .bss sections in relocatable
       object files. See commit for details; fixes misc GHCi crashes reported
       against 6.4.1.
      Merge to STABLE.
  4. 18 Oct, 2005 1 commit
    • panne's avatar
      [project @ 2005-10-18 11:04:28 by panne] · c30b7a08
      panne authored
      For the 100th time: Fixed the DocBook XML. >:-( Please, please, please:
      Everybody should do a "make validate" before checking in any XML stuff!
  5. 17 Oct, 2005 7 commits
    • simonpj's avatar
      [project @ 2005-10-17 11:11:15 by simonpj] · 9137abfe
      simonpj authored
      Buglets in GADT record-syntax stuff, which killed the weekend builds
    • simonpj's avatar
      [project @ 2005-10-17 11:10:36 by simonpj] · b16992d6
      simonpj authored
      Small simplifier bug in case optimisation
      The simplifier eliminates redundant case branches, and panics if there
      are no case alternatives.  But due to a slightly delayed instantiation
      of a type constructor variable 'p' by a type constructor 'P', it turned
      out that an inner case had no alternatives at all, becuase an outer case
      had not pruned a branch as quickly as it should have.
      This commit fixes both problems:
      a) SimplUtils.mkCase1 now returns a call to 'error' (instead of panicing)
         when it gets an empty list of alternatives.   Somewhat analogous to
         the inaccessible GADT case in Simplify.simplifyAlt
      b) In SimplUtils.prepareDefault, use the up-to-date scrutinee, rather than
         the less up-to-date case_bndr, to get the case type constructor.  That
         leads to slightly earlier pruning of inaccessible branches.
      Fixes a bug reported by Ian Lynagh.
      Test is simplCore/should_compile/simpl013
    • simonpj's avatar
      [project @ 2005-10-17 11:09:51 by simonpj] · e8883060
      simonpj authored
      Comments only
    • simonmar's avatar
      [project @ 2005-10-17 10:47:10 by simonmar] · 97850bac
      simonmar authored
      merge rev. from ghc-6-4-branch
    • simonmar's avatar
      [project @ 2005-10-17 10:01:35 by simonmar] · 666d1369
      simonmar authored
      Fix a comment
    • simonmar's avatar
      [project @ 2005-10-17 09:42:56 by simonmar] · 7bffe7e8
      simonmar authored
      note about watching for/preventing overwrites of critical files in the
      bootstrap process.
    • simonmar's avatar
      [project @ 2005-10-17 09:36:39 by simonmar] · 97ab9c1b
      simonmar authored
      if TARGETPLATFORM differs from HOSTPLATFORM, don't attempt to build
      DerivedConstants,h, ghcautoconf.h and GHCConstants.h.  If these aren't
      present, emit a message to remind the user to copy them from the
      target system.  Hopefully this should make bootstrapping slightly less
      error prone.
  6. 14 Oct, 2005 4 commits
    • simonmar's avatar
      [project @ 2005-10-14 13:11:21 by simonmar] · 676f9567
      simonmar authored
      StrHash doesn't appear to be used; remove it.  I think it was an
      earlier version of the string hashing code in Hash.c.
    • simonmar's avatar
      [project @ 2005-10-14 12:29:53 by simonmar] · 1c7854b5
      simonmar authored
      Some more informative diagnostics for ghc -v about what the package
      system is doing.  This should help when diagnosing strange-looking
      errors from GHC:
      Using package config file: /home/simonmar/fp/lib/i386-unknown-linux/ghc-6.4.1/package.conf
      package posix-1.0 will be ignored due to missing dependencies:
      package util-1.0 will be ignored due to missing dependencies:
      package data-1.0 will be ignored due to missing dependencies:
      package text-1.0 will be ignored due to missing dependencies:
      package Cabal-1.1.4 will be ignored due to missing dependencies:
      *** Deleting temp files
      ghc-6.4.1: unknown package: Cabal-1.1.4
    • simonmar's avatar
      [project @ 2005-10-14 11:48:56 by simonmar] · a004ae5a
      simonmar authored
      Fix a couple of problems with the "unknown package" error message
    • simonpj's avatar
      [project @ 2005-10-14 11:22:41 by simonpj] · 36436bc6
      simonpj authored
      Add record syntax for GADTs
      Atrijus Tang wanted to add record syntax for GADTs and existential
      types, so he and I worked on it a bit at ICFP.  This commit is the
      result.  Now you can say
       data T a where
        T1 { x :: a }           	 :: T [a]
        T2 { x :: a, y :: Int } 	 :: T [a]
        forall b. Show b =>
       	T3 { naughty :: b, ok :: Int } :: T Int
        T4 :: Eq a => a -> b -> T (a,b)
      Here the constructors are declared using record syntax.
      Still to come after this commit:
        - User manual documentation
        - More regression tests
        - Some missing cases in the parser (e.g. T3 won't parse)
      Autrijus is going to do these.
      Here's a quick summary of the rules.  (Atrijus is going to write
      proper documentation shortly.)
      Defnition: a 'vanilla' constructor has a type of the form
      	forall a1..an. t1 -> ... -> tm -> T a1 ... an
      No existentials, no context, nothing.  A constructor declared with
      Haskell-98 syntax is vanilla by construction.  A constructor declared
      with GADT-style syntax is vanilla iff its type looks like the above.
      (In the latter case, the order of the type variables does not matter.)
      * You can mix record syntax and non-record syntax in a single decl
      * All constructors that share a common field 'x' must have the
        same result type (T [a] in the example).
      * You can use field names without restriction in record construction
        and record pattern matching.
      * Record *update* only works for data types that only have 'vanilla'
      * Consider the field 'naughty', which uses a type variable that does
        not appear in the result type ('b' in the example).  You can use the
        field 'naughty' in pattern matching and construction, but NO
        SELECTOR function is generated for 'naughty'.  [An attempt to use
        'naughty' as a selector function will elicit a helpful error
      * Data types declared in GADT syntax cannot have a context. So this
      is illegal:
      	data (Monad m) => T a where
      * Constructors in GADT syntax can have a context (t.g. T3, T4 above)
        and that context is stored in the constructor and made available
        when the constructor is pattern-matched on.  WARNING: not competely
        implemented yet, but that's the plan.
      Implementation notes
      - Data constructors (even vanilla ones) no longer share the type
        variables of their parent type constructor.
      - HsDecls.ConDecl has changed quite a bit
      - TyCons don't record the field labels and type any more (doesn't
        make sense for existential fields)
      - GlobalIdDetails records which selectors are 'naughty', and hence
        don't have real code.
  7. 13 Oct, 2005 1 commit
  8. 12 Oct, 2005 8 commits
  9. 11 Oct, 2005 1 commit
  10. 10 Oct, 2005 3 commits
  11. 07 Oct, 2005 1 commit
  12. 06 Oct, 2005 6 commits
  13. 05 Oct, 2005 3 commits