summaryrefslogtreecommitdiff
path: root/rts/Prelude.h
Commit message (Collapse)AuthorAgeFilesLines
* compiler: fix trac issue #9817Marios Titas2014-12-101-2/+2
| | | | | | | | | | | | | | | | | | | Summary: When we call runHandlers, we must pass it a ForeignPtr. To ensure that this happens, we introduce a wrapper that receives a plain Ptr and converts it into a ForeignPtr. Then we adjust startSignalHandlers in rts/posix/Signals.c to call the wrapper instead of calling runHandlers directly. Reviewers: hvr, austin, rwbarton, simonmar Reviewed By: austin, simonmar Subscribers: simonmar, thomie, carter Differential Revision: https://phabricator.haskell.org/D515 GHC Trac Issues: #9817
* Per-thread allocation counters and limitsSimon Marlow2014-11-121-0/+2
| | | | | | | | This reverts commit f0fcc41d755876a1b02d1c7c79f57515059f6417. New changes: now works on 32-bit platforms too. I added some basic support for 64-bit subtraction and comparison operations to the x86 NCG.
* Revert "Rename _closure to _static_closure, apply naming consistently."Edward Z. Yang2014-10-201-45/+41
| | | | | | | This reverts commit 35672072b4091d6f0031417bc160c568f22d0469. Conflicts: compiler/main/DriverPipeline.hs
* Rename _closure to _static_closure, apply naming consistently.Edward Z. Yang2014-10-011-41/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In preparation for indirecting all references to closures, we rename _closure to _static_closure to ensure any old code will get an undefined symbol error. In order to reference a closure foobar_closure (which is now undefined), you should instead use STATIC_CLOSURE(foobar). For convenience, a number of these old identifiers are macro'd. Across C-- and C (Windows and otherwise), there were differing conventions on whether or not foobar_closure or &foobar_closure was the address of the closure. Now, all foobar_closure references are addresses, and no & is necessary. CHARLIKE/INTLIKE were not changed, simply alpha-renamed. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D265 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D267 GHC Trac Issues: #8199
* Revert "rts: add Emacs 'Local Variables' to every .c file"Simon Marlow2014-09-291-8/+0
| | | | This reverts commit 39b5c1cbd8950755de400933cecca7b8deb4ffcd.
* rts: add Emacs 'Local Variables' to every .c fileAustin Seipp2014-07-281-0/+8
| | | | | | | | This will hopefully help ensure some basic consistency in the forward by overriding buffer variables. In particular, it sets the wrap length, the offset to 4, and turns off tabs. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Raise exceptions when blocked in bad FDs (fixes Trac #4934)Sergei Trofimovich2014-06-081-0/+2
| | | | | | | | | | | | | | | Before the patch any call to 'select()' with 'bad_fd' led to: - unblocking of all threads - hiding exception for 'threadWaitRead bad_fd' The patch fixes both cases in this way: after 'select()' failure we iterate over each blocked descriptor and poll individually to see it's actual status, which is: - READY (move to run queue) - BLOCKED (leave in blocked queue) - INVALID (send an IOErrror exception) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Revert "Per-thread allocation counters and limits"Simon Marlow2014-05-041-2/+0
| | | | | | | | Problems were found on 32-bit platforms, I'll commit again when I have a fix. This reverts the following commits: 54b31f744848da872c7c6366dea840748e01b5cf b0534f78a73f972e279eed4447a5687bd6a8308e
* Per-thread allocation counters and limitsSimon Marlow2014-05-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This tracks the amount of memory allocation by each thread in a counter stored in the TSO. Optionally, when the counter drops below zero (it counts down), the thread can be sent an asynchronous exception: AllocationLimitExceeded. When this happens, given a small additional limit so that it can handle the exception. See documentation in GHC.Conc for more details. Allocation limits are similar to timeouts, but - timeouts use real time, not CPU time. Allocation limits do not count anything while the thread is blocked or in foreign code. - timeouts don't re-trigger if the thread catches the exception, allocation limits do. - timeouts can catch non-allocating loops, if you use -fno-omit-yields. This doesn't work for allocation limits. I couldn't measure any impact on benchmarks with these changes, even for nofib/smp.
* Build fix for dyn way on Windows; patch from nusIan Lynagh2013-02-161-0/+1
|
* setNumCapabilities calls GHC.Conc.IO.ioManagerCapabilitiesChanged before ↵Andreas Voellmy2013-02-111-0/+1
| | | | | | returning. This enables the IO manager to change the number of IO loops it uses (usually one per capability).
* Follow the move of the Word type to ghc-primIan Lynagh2012-05-221-4/+4
|
* Remove executable mode from some filesDavid Terei2011-11-161-0/+0
|
* fix dynamic way on Win32 (missing bits from flushStdHandles changes)Dimitrios Vytiniotis2011-11-091-0/+2
|
* Flush stdout and stderr during hs_exit() (#5594)Simon Marlow2011-11-081-0/+2
| | | | | | | Ensures that these handles are flushed even when the RTS is being used as a library, with no main. Needs a corresponding change to libraries/base.
* SafeHaskell: Make base GHC.* modules untrustedDavid Terei2011-06-171-14/+14
|
* SafeHaskell: Fix compilation errors.David Terei2011-06-171-2/+2
|
* SafeHaskell: Even more fixing to work with safe baseDavid Terei2011-06-171-2/+2
|
* SafeHaskell: More fixing to work with safe baseDavid Terei2011-06-171-14/+14
|
* Follow GHC.Bool/GHC.Types mergeIan Lynagh2010-10-231-4/+4
|
* Integrate new I/O manager, with signal supportJohan Tibell2010-07-241-6/+6
|
* New asynchronous exception control API (ghc parts)Simon Marlow2010-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | As discussed on the libraries/haskell-cafe mailing lists http://www.haskell.org/pipermail/libraries/2010-April/013420.html This is a replacement for block/unblock in the asychronous exceptions API to fix a problem whereby a function could unblock asynchronous exceptions even if called within a blocked context. The new terminology is "mask" rather than "block" (to avoid confusion due to overloaded meanings of the latter). In GHC, we changed the names of some primops: blockAsyncExceptions# -> maskAsyncExceptions# unblockAsyncExceptions# -> unmaskAsyncExceptions# asyncExceptionsBlocked# -> getMaskingState# and added one new primop: maskUninterruptible# See the accompanying patch to libraries/base for the API changes.
* Add some missing getStablePtr()s for CAFs that the RTS refers toSimon Marlow2010-01-221-0/+2
| | | | | | | | A recent patch ("Refactor CoreArity a bit") changed the arity of GHC.Conc.runSparks such that it became a CAF, and the RTS was not explicitly retaining it, which led to a crash when the CAF got GC'd. While fixing this I found a couple of other closures that the RTS refers to which weren't getting the correct CAF treatment.
* RTS also uses runSparks_closure from baseBen.Lippmeier@anu.edu.au2009-11-141-0/+2
|
* Handle renames from #3310Simon Marlow2009-08-301-4/+4
| | | | | Also add a panic for resurrecting a thread blocked on an exception, since it should never happen.
* Changes for the new IO library, mainly base-package modules moving aroundSimon Marlow2009-05-291-8/+8
|
* Rewrite of signal-handling (ghc patch; see also base and unix patches)Simon Marlow2009-02-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The API is the same (for now). The new implementation has the capability to define signal handlers that have access to the siginfo of the signal (#592), but this functionality is not exposed in this patch. #2451 is the ticket for the new API. The main purpose of bringing this in now is to fix race conditions in the old signal handling code (#2858). Later we can enable the new API in the HEAD. Implementation differences: - More of the signal-handling is moved into Haskell. We store the table of signal handlers in an MVar, rather than having a table of StablePtrs in the RTS. - In the threaded RTS, the siginfo of the signal is passed down the pipe to the IO manager thread, which manages the business of starting up new signal handler threads. In the non-threaded RTS, the siginfo of caught signals is stored in the RTS, and the scheduler starts new signal handler threads.
* Run sparks in batches, instead of creating a new thread for each oneSimon Marlow2008-11-061-0/+1
| | | | | Signficantly reduces the overhead for par, which means that we can make use of paralellism at a much finer granularity.
* Fix references to exceptions from the RTSIan Lynagh2008-08-211-5/+5
| | | | | We now need to make sure that they have been toException'd. Also, the RTS doesn't know about the Deadlock exception any more.
* get exception names from Control.Exception.Base instead of Control.ExceptionRoss Paterson2008-08-121-4/+4
|
* Move Int, Float and Double into ghc-prim:GHC.TypesIan Lynagh2008-08-061-12/+12
|
* C# has moved to ghc-prim:GHC.TypesIan Lynagh2008-08-051-4/+4
|
* Follow extensible exception changesIan Lynagh2008-07-301-4/+4
|
* When raising NonTermination with the RTS, build the right valueIan Lynagh2008-06-211-2/+2
| | | | | | We now use a nonTermination value in the base library to take take of constructing the SomeException value, with the dictionaries etc, for us. We'll probably need to do the same for some other exceptions too
* Follow library changesIan Lynagh2008-03-231-4/+4
| | | | | Integer, Bool and Unit/Inl/Inr are now in new packages integer and ghc-prim.
* Build RTS as dynamic libraryClemens Fruhwirth2007-08-081-47/+47
|
* Add support for the IO manager thread on WindowsSimon Marlow2006-12-011-2/+0
| | | | | | | | | | | | | | | | | | | Fixes #637. The implications of this change are: - threadDelay on Windows no longer creates a new OS thread each time, instead it communicates with the IO manager thread in the same way as on Unix. - deadlock detection now works the same way on Windows as on Unix; that is the timer interrupt wakes up the IO manager thread, which causes the scheduler to check for deadlock. - Console events now get sent to the IO manager thread, in the same way as signals do on Unix. This means that console events should behave more reliably with -threaded on Windows. All this applies only with -threaded. Without -threaded, the old ConsoleEvent code is still used. After some testing, this could be pushed to the 6.6 branch.
* change wired-in Haskell symbols to include the package nameSimon Marlow2006-07-261-90/+90
|
* Better control of the IO manager thread; improvements to deadlock checkingSimon Marlow2006-05-241-0/+4
| | | | | | | | | | | | | | | | | In the threaded RTS on *nix platforms: - we now start the IO manager thread eagerly at startup time (previously was started on demand). - we now ask the IO manager thread to stop at shutdown - In Timer.c:handle_tick, if it looks like we might be in a deadlock, instead of calling prodOneCapability() which was known to be wrong, we now send a byte down the IO manager's pipe to wake it up. This also avoids a case of double-acquisition of a mutex, which happened if prodOneCapability() was called while the current thread was holding a mutex.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+129
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.