summaryrefslogtreecommitdiff
path: root/rts/win32
Commit message (Collapse)AuthorAgeFilesLines
...
* protect console handler against concurrent access (#1922)Simon Marlow2007-12-041-3/+11
|
* On Windows, Delete the CriticalSection's we InitializeIan Lynagh2007-11-253-0/+4
|
* Refactoring: extract platform-specific code from sm/MBlock.cSimon Marlow2007-10-171-2/+227
| | | | Also common-up some duplicate bits in the platform-specific code
* fix an error message (barf -> sysErrorBelch)Simon Marlow2007-10-171-2/+3
|
* remove debugging codeSimon Marlow2007-09-031-2/+0
|
* FIX #1623: disable the timer signal when the system is idle (threaded RTS only)Simon Marlow2007-09-031-28/+57
| | | | | | | | | | Having a timer signal go off regularly is bad for power consumption, and generally bad practice anyway (it means the app cannot be completely swapped out, for example). Fortunately the threaded RTS already had a way to detect when the system was idle, so that it can trigger a GC and thereby find deadlocks. After performing the GC, we now turn off timer signals, and re-enable them again just before running any Haskell code.
* Windows: remove the {Enter,Leave}CricialSection wrappersSimon Marlow2007-08-291-8/+0
| | | | | | The C-- parser was missing the "stdcall" calling convention for foreign calls, but once added we can call {Enter,Leave}CricialSection directly.
* Jump through some hoops to make the Windows SEH exception stuff happyIan Lynagh2007-08-242-0/+133
|
* Fix the threaded RTS on WindowsIan Lynagh2007-08-161-0/+9
| | | | | When calling EnterCriticalSection and LeaveCriticalSection from C-- code, we go via wrappers which use ccall (rather than stdcall).
* FIX #1177, partially at least.Simon Marlow2007-07-254-17/+19
| | | | | | | | | | | Now we don't wait for outstanding IO requests when shutting down at program exit time, but we still wait when shutting down a DLL (via hs_exit()). There ought to be a better way to do this, but terminating the threads forcibly is not a good idea (it never is: the thread might be holding a mutex when it dies, for example). I plan to add some docs to the user guide to describe how to shut down a DLL properly.
* Fix C/Haskell type mismatchesIan Lynagh2007-04-031-5/+5
|
* Use timer_create() for the interval timer, if availableSimon Marlow2007-03-021-4/+7
| | | | | | | | | | | This lets the threaded RTS use SIGVTALRM rather than SIGALRM for its interval timer signal, so the threaded and non-threaded RTS are compatible. It unfortunately doesn't completely fix #850/#1156, for that we really have to use a restartable sleep instead of usleep(). Also I cleaned up the timer API a little: instead of returning an error value that ultimately gets ignored, we now report errors from system calls and exit.
* Free thread local storage on shutdownIan Lynagh2007-02-221-0/+11
|
* Fix sleep delay for the non-threaded Windows RTSSimon Marlow2007-02-201-1/+1
| | | | | This is the Windows counterpart to "Make the non-threaded-RTS threadDelay wait at least as long as asked"
* Partial fix for #926Simon Marlow2007-02-011-2/+22
| | | | | | | | | | | | | | It seems that when a program exits with open DLLs on Windows, the system attempts to shut down the DLLs, but it also terminates (some of?) the running threads. The RTS isn't prepared for threads to die unexpectedly, so it sits around waiting for its workers to finish. This bites in two places: ShutdownIOManager() in the the unthreaded RTS, and shutdownCapability() in the threaded RTS. So far I've modified the latter to notice when worker threads have died unexpectedly and continue shutting down. It seems a bit trickier to fix the unthreaded RTS, so for now the workaround for #926 is to use the threaded RTS.
* Free more things that we allocate2006-12-16Ian Lynagh2006-12-151-0/+5
|
* Add support for the IO manager thread on WindowsSimon Marlow2006-12-013-16/+179
| | | | | | | | | | | | | | | | | | | 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.
* Remove the Windows Async IO Manager completely in THREADED_RTS modeSimon Marlow2006-12-012-0/+9
| | | | | It isn't used here anyway, just making sure the code doesn't get compiled in.
* remove unused includes, now that Storage.h & Stable.h are included by Rts.hSimon Marlow2006-11-151-2/+0
|
* mark stop event handle as invalid once closed, making shutdowns more graceful.sof@galois.com2006-10-161-1/+5
|
* add a few #includes to make it compilesof@galois.com2006-11-011-1/+4
|
* add sysErrorBelch() for reporting system call errorsSimon Marlow2006-08-301-3/+5
|
* call ShutdownIOManager() before closing handlesSimon Marlow2006-08-301-1/+1
| | | | | | | To avoid IO requests completing only to discover that the completed_table_sema has been CloseHandle()'d. This all looks a bit wrong, though: we shouldn't really be waiting for these requests to complete, they might take forever.
* oops, got the sense of the error case wrongSimon Marlow2006-08-291-1/+1
|
* fix some rerrors in the worker countingSimon Marlow2006-08-291-6/+10
|
* Free Win32 Handles on shutdownSimon Marlow2006-08-255-12/+54
| | | | patch from #878
* Add closeMutex and use it on clean upEsa Ilari Vuokko2006-08-231-0/+10
|
* Remove few format-warnings by adding castsEsa Ilari Vuokko2006-08-131-2/+2
|
* markSignalHandlers(): implementation was unnecessary, and had a bugsimonmar@microsoft.com2006-06-061-4/+2
| | | | | | | | | | There's no need to mark the signal handler here, because it is stored in a StablePtr and hence is a root anyway. Furthermore, the call to evac() was passing the address of a local variable, which turned out to be harmless for copying GC, but fatal for compacting GC: compacting GC assumes that the addresses of the roots are the same each time. Fixes: possibly #783, possibly #776, definitely #787
* fix Win32 buildsimonmar@microsoft.com2006-05-301-2/+4
|
* replace stgMallocBytesRWX() with our own allocatorSimon Marlow2006-05-301-0/+34
| | | | | | | | | | | | | | | | | | | | See bug #738 Allocating executable memory is getting more difficult these days. In particular, the default SELinux policy on Fedora Core 5 disallows making the heap (i.e. malloc()'d memory) executable, although it does apparently allow mmap()'ing anonymous executable memory by default. Previously, stgMallocBytesRWX() used malloc() underneath, and then tried to make the page holding the memory executable. This was rather hacky and fails with Fedora Core 5. This patch adds a mini-allocator for executable memory, based on the block allocator. We grab page-sized blocks and make them executable, then allocate small objects from the page. There's a simple free function, that will free whole pages back to the system when they are empty.
* Reorganisation of the source treeSimon Marlow2006-04-0712-0/+2093
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.