1. 23 Sep, 2003 1 commit
  2. 22 Sep, 2003 3 commits
  3. 21 Sep, 2003 1 commit
    • wolfgang's avatar
      [project @ 2003-09-21 22:20:57 by wolfgang] · 5aef5c62
      wolfgang authored
      Bound Threads
      =============
      
      Introduce a way to use foreign libraries that rely on thread local state
      from multiple threads (mainly affects the threaded RTS).
      
      See the file threads.tex in CVS at haskell-report/ffi/threads.tex
      (not entirely finished yet) for a definition of this extension. A less formal
      description is also found in the documentation of Control.Concurrent.
      
      The changes mostly affect the THREADED_RTS (./configure --enable-threaded-rts),
      except for saving & restoring errno on a per-TSO basis, which is also necessary
      for the non-threaded RTS (a bugfix).
      
      Detailed list of changes
      ------------------------
      
      - errno is saved in the TSO object and restored when necessary:
      ghc/includes/TSO.h, ghc/rts/Interpreter.c, ghc/rts/Schedule.c
      
      - rts_mainLazyIO is no longer needed, main is no special case anymore
      ghc/includes/RtsAPI.h, ghc/rts/RtsAPI.c, ghc/rts/Main.c, ghc/rts/Weak.c
      
      - passCapability: a new function that releases the capability and "passes"
        it to a specific OS thread:
      ghc/rts/Capability.h ghc/rts/Capability.c
      
      - waitThread(), scheduleWaitThread() and schedule() get an optional
        Capability *initialCapability passed as an argument:
      ghc/includes/SchedAPI.h, ghc/rts/Schedule.c, ghc/rts/RtsAPI.c
      
      - Bound Thread scheduling (that's what this is all about):
      ghc/rts/Schedule.h, ghc/rts/Schedule.c
      
      - new Primop isCurrentThreadBound#:
      ghc/compiler/prelude/primops.txt.pp, ghc/includes/PrimOps.h, ghc/rts/PrimOps.hc,
      ghc/rts/Schedule.h, ghc/rts/Schedule.c
      
      - a simple function, rtsSupportsBoundThreads, that returns true if THREADED_RTS
        is defined:
      ghc/rts/Schedule.h, ghc/rts/Schedule.c
      
      - a new implementation of forkProcess (the old implementation stays in place
        for the non-threaded case). Partially broken; works for the standard
        fork-and-exec case, but not for much else. A proper forkProcess is
        really next to impossible to implement:
      ghc/rts/Schedule.c
      
      - Library support for bound threads:
          Control.Concurrent.
            rtsSupportsBoundThreads, isCurrentThreadBound, forkOS,
            runInBoundThread, runInUnboundThread
      libraries/base/Control/Concurrent.hs, libraries/base/Makefile,
      libraries/base/include/HsBase.h, libraries/base/cbits/forkOS.c (new file)
      5aef5c62
  4. 16 Sep, 2003 2 commits
  5. 12 Sep, 2003 2 commits
  6. 10 Sep, 2003 2 commits
    • simonmar's avatar
      [project @ 2003-09-10 14:45:24 by simonmar] · d223107b
      simonmar authored
      Quick hack to work around the dynamic exception crashes in GHCi.  The
      problem is this: the Data.Typeable library (Data.Dymamic in previous
      versions of GHC) maintains an internal cache mapping type names to
      unique numbers, and this cache is used for fast comparisons on
      TypeReps.  In GHCi, there are actually two versions of the
      Data.Typeable library loaded: one linked to GHCi itself, and the other
      dynamically loaded, so there are two copies of the hash tables.
      
      The problem is that if we have a Dynamic value generated using one set
      of hash tables, it will erroneously appear to be of a different type
      when the other hash tables are used.
      
      The hack I've instigated is to use the central RTS genSym (which
      already exists) to generate the unique Ids, so that the two copies of
      the dynamic library will be using distinct Ids, and Dynamics from one
      will never be recognisable to the other.
      d223107b
    • simonmar's avatar
      [project @ 2003-09-10 11:46:58 by simonmar] · 012b14c8
      simonmar authored
      The finalizer for a ForeignPtr created with mallocForeignPtr better
      "touch#" the MutableByteArray# after running the other finalizers,
      otherwise the memory might be garbage collected before we've finished
      running the finalizers.
      
      This can cause crashes if you add any extra finalizers to a ForeignPtr
      created with mallocForeignPtr.
      
      SourceForge bug: #802692
      012b14c8
  7. 08 Sep, 2003 2 commits
  8. 05 Sep, 2003 2 commits
  9. 03 Sep, 2003 1 commit
  10. 02 Sep, 2003 2 commits
    • ross's avatar
      [project @ 2003-09-02 16:07:08 by ross] · 03bef664
      ross authored
      Deal with systems on which PATH_MAX is undefined, e.g. systems with
      unlimited path length, like the Hurd (also faulty installations of gcc
      on Solaris).  In fact getCurrentDirectory only needs a long path size
      to use as a first approximation, so give it that.
      03bef664
    • malcolm's avatar
      [project @ 2003-09-02 15:31:02 by malcolm] · f0be11eb
      malcolm authored
      For nhc98, take the corrected (thanks to Ross Paterson) version of
      fixIO from NHC.IOExtras.
      f0be11eb
  11. 01 Sep, 2003 1 commit
  12. 31 Aug, 2003 1 commit
  13. 30 Aug, 2003 3 commits
  14. 27 Aug, 2003 2 commits
  15. 26 Aug, 2003 2 commits
  16. 23 Aug, 2003 2 commits
  17. 22 Aug, 2003 3 commits
  18. 20 Aug, 2003 3 commits
    • panne's avatar
      [project @ 2003-08-20 15:54:45 by panne] · d0546904
      panne authored
      Nuked FPTOOLS_O_BINARY test and use FP_CHECK_CONST instead, which is
      shorter and better (e.g. cross compilation).
      d0546904
    • panne's avatar
      [project @ 2003-08-20 15:44:19 by panne] · 7c8d57b8
      panne authored
      * Cleaned up FP_CHECK_ALIGNMENT test a bit.
      
      * Nuked FPTOOLS_CHECK_CCONST test in favour of a more general one
        which handles cross compilation and languages different from C.
      7c8d57b8
    • simonmar's avatar
      [project @ 2003-08-20 10:22:44 by simonmar] · 7c64b6c7
      simonmar authored
      Use the wide-char classifications from the C library if available.
      This gives us Unicode-aware isLower, isUpper, isAlpha etc.
      
      On Unix, you have to set your locale to something.  This is usually
      done by setting the environment variable LANG, eg.
      
        export LANG=en
      
      This stuff *should* also work on Windows, except that Windows uses a
      16-bit wchar_t so will get it wrong for characters > '\xffff'.  However,
      I figured it was better to use the system-supplied functionality
      rather than trying to implement this stuff ourselves.
      7c64b6c7
  19. 19 Aug, 2003 3 commits
    • simonmar's avatar
      [project @ 2003-08-19 16:39:13 by simonmar] · fbf9b826
      simonmar authored
      Use the wide-char classifications from the C library if available.
      This gives us Unicode-aware isLower, isUpper, isAlpha etc.
      
      On Unix, you have to set your locale to something.  This is usually
      done by setting the environment variable LANG, eg.
      
        export LANG=en
      
      This stuff *should* also work on Windows, except that Windows uses a
      16-bit wchar_t so will get it wrong for characters > '\xffff'.  However,
      I figured it was better to use the system-supplied functionality
      rather than trying to implement this stuff ourselves.
      fbf9b826
    • simonmar's avatar
      [project @ 2003-08-19 16:34:11 by simonmar] · 70cce887
      simonmar authored
      Fix reversed flag in mkRegexWithOpts
      70cce887
    • simonmar's avatar
      [project @ 2003-08-19 16:33:03 by simonmar] · 49cf9694
      simonmar authored
      Fix incorrect Haddock syntax
      49cf9694
  20. 18 Aug, 2003 1 commit
    • panne's avatar
      [project @ 2003-08-18 12:46:21 by panne] · d052d711
      panne authored
      Revamped altzone detection. Note that we test only for successful
      compilation now, not for successful linking, but this is what most
      autoconf macros do.
      d052d711
  21. 11 Aug, 2003 1 commit