summaryrefslogtreecommitdiff
path: root/ghc/rts/posix
Commit message (Collapse)AuthorAgeFilesLines
* Add SA_RESTART flag to the timer signal handler.Simon Marlow2006-04-061-0/+11
| | | | | This seems to be necessary to prevent readline being confused by our SIGALRM handler.
* Improvements to shutting down of the runtimeSimon Marlow2006-03-152-4/+5
| | | | | | Yet another attempt at shutdown & interruption. This one appears to work better; ^C is more responsive in multi threaded / SMP, and I fixed one case where the runtime wasn't responding to ^C at all.
* [project @ 2006-01-18 10:31:50 by simonmar]simonmar2006-01-181-1/+0
| | | | | | | - fix a mixup in Capability.c regarding signals: signals_pending() is not used in THREADED_RTS - some cleanups and warning removal while I'm here
* [project @ 2006-01-16 16:38:24 by simonmar]simonmar2006-01-161-1/+1
| | | | | Default signal handlers weren't being installed; amazing that this has been broken ever since I rearranged the signal handling code.
* [project @ 2006-01-05 09:42:54 by simonmar]simonmar2006-01-051-1/+3
| | | | | This file is not quite POSIX compliant; hopefully fix build on MacOS X (Tiger)
* [project @ 2005-11-30 15:58:47 by simonmar]simonmar2005-11-301-0/+6
| | | | | check for overrun of the fd_set, some OSs give you more descriptors than FD_SETSIZE
* [project @ 2005-11-28 09:24:17 by simonpj]simonpj2005-11-281-1/+1
| | | | Patch from Atrijus alleged to fix FreeBSD build
* [project @ 2005-11-18 15:10:31 by simonmar]simonmar2005-11-181-1/+1
| | | | cosmetic
* [project @ 2005-11-03 16:47:45 by simonmar]simonmar2005-11-032-5/+5
| | | | adjust type of startSignalHandlers() to make changes to Win32 version
* [project @ 2005-11-03 16:23:24 by simonmar]simonmar2005-11-031-1/+1
| | | | wibble
* [project @ 2005-11-03 15:15:14 by simonmar]simonmar2005-11-031-2/+0
| | | | | Fixes for console event handling on Win32 in the threaded/SMP runtime. (it now builds, but is untested).
* [project @ 2005-11-03 11:05:38 by simonmar]simonmar2005-11-031-0/+139
| | | | | | | | | | | | | | | | | | | Improvments to time-measurement and stats: - move all the platform-dependent timing related stuff into posix/GetTime.c and win32/GetTime.c, with the machine-indepent interface specified in GetTime.h. This is now used by Stats.c. - On Unix, use gettimeofday() and getrusage() by default, falling back to time() if one of these isn't available. - try to implement thread-specfic CPU-time measurement using clock_gettime() on Unix. Doesn't work reliably on Linux, because the implemenation tries to use the processor TSC, which on an SMP machine goes wrong when the thread moves between CPUs. However, it's slightly less bogus that before, and hopefully will improve in the future.
* [project @ 2005-10-26 13:58:40 by simonmar]simonmar2005-10-261-1/+1
| | | | forkOS_createThreadWrapper: oops, better use the result from rts_evalStableIO()
* [project @ 2005-10-21 14:02:17 by simonmar]simonmar2005-10-217-0/+1237
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 implementations. - 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