summaryrefslogtreecommitdiff
path: root/rts/posix/Signals.c
Commit message (Collapse)AuthorAgeFilesLines
...
* don't overwrite io_manager_pipe if it is already setSimon Marlow2009-04-231-1/+3
| | | | Part of the fix for #3171
* check return value of write (quiets gcc)Simon Marlow2009-03-221-2/+6
|
* Instead of a separate context-switch flag, set HpLim to zeroSimon Marlow2009-03-131-1/+1
| | | | | | | | | | | | This reduces the latency between a context-switch being triggered and the thread returning to the scheduler, which in turn should reduce the cost of the GC barrier when there are many cores. We still retain the old context_switch flag which is checked at the end of each block of allocation. The idea is that setting HpLim may fail if the the target thread is modifying HpLim at the same time; the context_switch flag is a fallback. It also allows us to "context switch soon" without forcing an immediate switch, which can be costly.
* #2860: remove redundant unblocking of signalsSimon Marlow2009-02-191-7/+0
|
* Rewrite of signal-handling (ghc patch; see also base and unix patches)Simon Marlow2009-02-191-85/+86
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bugfix: don't ingore the return value from rts_evalIO()Simon Marlow2008-11-041-1/+1
|
* Move the context_switch flag into the CapabilitySimon Marlow2008-09-191-2/+2
| | | | | Fixes a long-standing bug that could in some cases cause sub-optimal scheduling behaviour.
* FIX part of #2301, and #1619Simon Marlow2008-07-091-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | 2301: Control-C now causes the new exception (AsyncException UserInterrupt) to be raised in the main thread. The signal handler is set up by GHC.TopHandler.runMainIO, and can be overriden in the usual way by installing a new signal handler. The advantage is that now all programs will get a chance to clean up on ^C. When UserInterrupt is caught by the topmost handler, we now exit the program via kill(getpid(),SIGINT), which tells the parent process that we exited as a result of ^C, so the parent can take appropriate action (it might want to exit too, for example). One subtlety is that we have to use a weak reference to the ThreadId for the main thread, so that the signal handler doesn't prevent the main thread from being subject to deadlock detection. 1619: we now ignore SIGPIPE by default. Although POSIX says that a SIGPIPE should terminate the process by default, I wonder if this decision was made because many C applications failed to check the exit code from write(). In Haskell a failed write due to a closed pipe will generate an exception anyway, so the main difference is that we now get a useful error message instead of silent program termination. See #1619 for more discussion.
* ANSI-ise a function declarationSimon Marlow2008-07-081-1/+1
|
* remove old #ifdef SMP bitsSimon Marlow2008-07-081-19/+0
|
* Reorganisation to fix problems related to the gct register variableSimon Marlow2008-04-161-3/+3
| | | | | | | | | - GCAux.c contains code not compiled with the gct register enabled, it is callable from outside the GC - marking functions are moved to their relevant subsystems, outside the GC - mark_root needs to save the gct register, as it is called from outside the GC
* We don't need a SIGCONT handler any moreSimon Marlow2007-07-041-29/+0
| | | | | | The SIGCONT handler was used to put stdin back in O_NONBLOCK mode, after the process is resumed, but we don't want to do that now: the standard handles are kept in blocking mode.
* Fix C/Haskell type mismatchesIan Lynagh2007-04-031-1/+1
|
* Warning police: Added missing #includesven.panne@aedion.de2006-12-301-0/+1
|
* Free more things that we allocate2006-12-16Ian Lynagh2006-12-151-0/+7
|
* remove unused includes, now that Storage.h & Stable.h are included by Rts.hSimon Marlow2006-11-151-2/+0
|
* Split GC.c, and move storage manager into sm/ directorySimon Marlow2006-10-241-0/+2
| | | | | | | | | | | | | | | | | In preparation for parallel GC, split up the monolithic GC.c file into smaller parts. Also in this patch (and difficult to separate, unfortunatley): - Don't include Stable.h in Rts.h, instead just include it where necessary. - consistently use STATIC_INLINE in source files, and INLINE_HEADER in header files. STATIC_INLINE is now turned off when DEBUG is on, to make debugging easier. - The GC no longer takes the get_roots function as an argument. We weren't making use of this generalisation.
* add sysErrorBelch() for reporting system call errorsSimon Marlow2006-08-301-3/+3
|
* missed one symbol that needs a package nameSimon Marlow2006-07-261-1/+1
|
* Better control of the IO manager thread; improvements to deadlock checkingSimon Marlow2006-05-241-0/+38
| | | | | | | | | | | | | | | | | 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/+510
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.