1. 25 May, 2005 3 commits
  2. 24 May, 2005 8 commits
  3. 23 May, 2005 11 commits
    • simonmar's avatar
      [project @ 2005-05-23 15:44:10 by simonmar] · 6d16c476
      simonmar authored
      Simplify and improve the Capability-passing machinery for bound
      threads.
      
      The old story was quite complicated: if you find a thread on the run
      queue which the current task can't run, you had to call
      passCapability(), which set a flag saying where the next Capability
      was to go, and then release the Capability.  When multiple
      Capabilities are flying around, it's not clear how this story should
      extend.
      
      The new story is much simpler: each time around the scheduler loop,
      the task looks to see whether it can make any progress, and if not, it
      releases its Capability and wakes up a task which *can* make some
      progress.  The predicate for whether we can make any progress is
      encapsulated in the (inline) function ANY_WORK_FOR_ME(Condition).
      Waking up an appropriate task is encapsulated in the function
      threadRunnable() (previously it was in two places).
      
      The logic in Capability.c is simpler, but unfortunately it is now more
      closely connected with the Scheduler, because it inspects the run
      queue.  However, performance when communicating between bound and
      unbound threads might be better.
      
      The concurrency tests still work, so hopefully this hasn't broken
      anything.
      6d16c476
    • simonpj's avatar
      [project @ 2005-05-23 14:49:59 by simonpj] · 58fa3624
      simonpj authored
      Print only the result of a bind stmt
      58fa3624
    • simonmar's avatar
      [project @ 2005-05-23 13:39:55 by simonmar] · 58150db0
      simonmar authored
      - scheduleDetectDeadlock() should invoke GarbageCollect() via
        scheduleDoGC(), which collects the Capabilities first.
      
      - scheduleDoGC() doesn't need the Capability.  Also, it appears that
        there was an out-of-bounds array access in here.
      
      - add printThreadQueue(), useful from gdb.
      
      - fix a couple of warnings.
      58150db0
    • simonpj's avatar
      [project @ 2005-05-23 13:00:46 by simonpj] · 7fe37ed4
      simonpj authored
      rename exportsFromAvail
      7fe37ed4
    • simonpj's avatar
      [project @ 2005-05-23 13:00:30 by simonpj] · 6b4e2574
      simonpj authored
      Further GHCi wibbles
      
      a) Don't print the value of a 'let'
      b) Only one error message for 'print id'
      6b4e2574
    • simonpj's avatar
      [project @ 2005-05-23 10:17:45 by simonpj] · added151
      simonpj authored
      Dead code (HEAD only)
      added151
    • simonpj's avatar
      [project @ 2005-05-23 10:17:22 by simonpj] · 6d4df3a3
      simonpj authored
      Fix what "standard class" means
      
      	MERGE to STABLE
      
      The Report's definition of defaulting (Section 4.3.4) defines a "standard class" to be
      one defined by the Prelude or a standard library.  GHC was omitting the "..or a standard
      library" part; and it even omitted the Prelude classes Monad and Functor.
      This commit fixes the bug by adding
      
      	Random, RandomGen,
      	Monad, MonadPlus, Functor
      
      to the classes defined as "standard".
      6d4df3a3
    • simonpj's avatar
      [project @ 2005-05-23 09:56:17 by simonpj] · 487920aa
      simonpj authored
      Comments and type sig only
      487920aa
    • simonpj's avatar
      [project @ 2005-05-23 09:56:03 by simonpj] · e164999e
      simonpj authored
      Track new semantics of splitLongestPrefix; fixes -main-is bug
      e164999e
    • simonpj's avatar
      [project @ 2005-05-23 09:50:26 by simonpj] · 9af07e05
      simonpj authored
      Clarify code for splitLongestPrefix; no effect on behaviour
      9af07e05
    • simonmar's avatar
      [project @ 2005-05-23 08:22:06 by simonmar] · 4c03d4ee
      simonmar authored
      needsCDecl: remove extra equation for CaseLabel, which was overlapped
      (and wrong!).
      4c03d4ee
  4. 21 May, 2005 5 commits
  5. 20 May, 2005 8 commits
    • krasimir's avatar
      [project @ 2005-05-20 14:40:50 by krasimir] · 65ebd31a
      krasimir authored
      Bugfix: in rtsFatalInternalErrorFn vsnprintf function was used instead of
      snprintf. The code is changed so that the error message will be displayed
      even if it is longer that BUFSIZE.
      65ebd31a
    • simonmar's avatar
      [project @ 2005-05-20 12:50:42 by simonmar] · f775e3cc
      simonmar authored
      Implement some more error checking to catch some cases where
      registering a package will lead to a package database containing
      conflicts, which would otherwise prevent GHC from being used without
      any -hide-package options.
      
      In 'update' mode, instead of complaining about conflicts, we now
      attempt to hide any packages which would cause a conflict.  Previously
      this was limited to just older versions of the current package, now it
      applies to all packages which contain, or depend on packages which
      contain, modules which conflict with any module belonging to the
      current package or a dependency of it.
      
      Unfortunately we still can't cope with conflicts that cross the
      boundary between the user package databse and the global one.  We will
      need some kind of white-out mechanism in order to be able to hide a
      global package in the user database.
      f775e3cc
    • simonpj's avatar
      [project @ 2005-05-20 12:28:14 by simonpj] · 79e3a86b
      simonpj authored
      Documentation for new GHCi behaviour
      79e3a86b
    • simonpj's avatar
      [project @ 2005-05-20 12:06:00 by simonpj] · 415aab77
      simonpj authored
      Further wibble to preceding GHCi commit
      415aab77
    • simonpj's avatar
      [project @ 2005-05-20 11:58:01 by simonpj] · d1429dbd
      simonpj authored
      Wibble to preceding GHCi commit
      d1429dbd
    • simonpj's avatar
      [project @ 2005-05-20 11:42:57 by simonpj] · 02a06a56
      simonpj authored
      Improve the GHCi interaction
      
      		Merge to STABLE?
      
      This fix addresses Sourceforge #1156554 "GHCi: No instance for (Show (IO ()))",
      and simultaneously improves the top-level interaction in two other ways:
      
      - Only one error can show up (previously there could be two)
      
      - If an I/O action gives a Showable result, the result is printed
        (provided it isn't ()).  So
      	prompt> return 4
        prints 4, rather than nothing
      
      - For command-line 'let' and 'x<-e' forms, if exactly one variable
        is bound, we print its value if it is Showable and not ()
      	prompt> let x = 4
      	4
      	prompt> x <- return 5
      	5
      02a06a56
    • simonpj's avatar
      [project @ 2005-05-20 11:32:03 by simonpj] · 40d3a06b
      simonpj authored
      Liberalise the defaulting rules for GHCi
      
      		Merge to STABLE?
      
      The H98 defaulting rules are these.  Group constraints of the form (C v),
      for some particular type variable v. Then default v if
      
      a) v appears only in this group (no implicit params or D [v])
      b) at least one of the C's is numeric
      c) all the C's are standard
      
      GHCi changed rules (b) to
      
      (b') at least one of the C's is numeric, or Eq,Ord,Show
      
      This commit further liberalises GHCi to change (c):
      
      (c') any of the C's are standard
      
      Otherwise the existence of a non-standard class (e.g. Random) is enough
      to kill defaulting altogether.
      40d3a06b
    • simonpj's avatar
      [project @ 2005-05-20 11:31:46 by simonpj] · 79cbcc81
      simonpj authored
      Comments only
      79cbcc81
  6. 19 May, 2005 5 commits
    • simonmar's avatar
      [project @ 2005-05-19 13:46:24 by simonmar] · 88825a2e
      simonmar authored
      Fix locking when unblocking a thread in take/putMVar.  Due to CPP
      nonsense the previous locking wasn't actually working, which lead to
      deadlock problems.  It now turns out that I can call unblockOne
      directly rather than needing unblockOneLocked (the lock on the MVar
      means I have exclusive access to the threads on its queue).
      88825a2e
    • simonmar's avatar
      [project @ 2005-05-19 13:21:55 by simonmar] · 3595da95
      simonmar authored
      - Move the call to threadPaused() from the scheduler into STG land,
        and put it in a new code fragment (stg_returnToSched) that we pass
        through every time we return from STG to the scheduler.  Also, the
        SAVE_THREAD_STATE() is now in stg_returnToSched which might save a
        little code space (at the expense of an extra jump for every return
        to the scheduler).
      
      - SMP: when blocking on an MVar, we now wait until the thread has been
        made fully safe and placed on the blocked queue of the MVar before
        we unlock the MVar.  This closes a race whereby another OS thread could
        begin waking us up before the current TSO had been properly tidied up.
      
      Fixes one cause of crashes when using MVars with SMP.  I still have a
      deadlock problem to track down.
      3595da95
    • simonmar's avatar
      [project @ 2005-05-19 11:17:20 by simonmar] · eab2c6c4
      simonmar authored
      SMP: omit the -pthread flag on Windows
      eab2c6c4
    • simonpj's avatar
      [project @ 2005-05-19 11:15:40 by simonpj] · 4a587049
      simonpj authored
      Tune up the reporting of unused imports
      
      		Merge to STABLE
      	(I think the earlier change made it across)
      	(PS: the commit also does some trimming of
      	redundant imports.  If they don't merge, just
      	discard them.)
      
      My earlier fixes to the reporting of unused imports still missed
      some obscure cases, some of which are now fixed by this commit.
      I had to make the import-provenance data type yet richer, but in
      fact it has more sharing now, so it may be cheaper on space.
      
      There's still one infelicity. Consider
      		import M( x )
      		imoprt N( x )
      where the same underlying 'x' is involved in both cases.  Currently we
      don't report a redundant import, because dropping either import would
      change the qualified names in scope (M.x, N.x). But if the qualified
      names aren't used, the import is indeed redundant. Sadly we don't know
      that, because we only know what Names are used.  Left for the future!
      There's a comment in RnNames.warnDuplicateImports
      
      This commit also trims quite a few redundant imports disovered
      by the new setup.
      4a587049
    • simonmar's avatar
      [project @ 2005-05-19 11:13:23 by simonmar] · f01b31dd
      simonmar authored
      Add required include: #include "RtsFlags.h"
      f01b31dd