summaryrefslogtreecommitdiff
path: root/rts/win32
Commit message (Collapse)AuthorAgeFilesLines
...
* Close the handle for the ticker thread (#5604)Simon Marlow2011-11-111-1/+2
|
* fix dynamic way on Win32 (missing bits from flushStdHandles changes)Dimitrios Vytiniotis2011-11-091-0/+2
|
* Close some handle leaks (#5604)Simon Marlow2011-11-091-9/+21
| | | | | Also, use the Win32 API (CreateThread) instead of the CRT API (_beginthreadex) for thread creation.
* Add rts time util getUnixEpochTimeDuncan Coutts2011-10-261-0/+40
| | | | | | The other existing time utilities give us time elapsed since process or thread start. This is for wall clock time, using the common Unix epoch interpretation.
* Delete some old Win9x C codeDuncan Coutts2011-10-261-24/+0
|
* SafeHaskell: Fix compilation errors.David Terei2011-06-171-2/+2
|
* SafeHaskell: Even more fixing to work with safe baseDavid Terei2011-06-171-2/+2
|
* Fix compilation of rts/win32/GetEnv.cunknown2011-06-051-2/+3
|
* Emit various bits of OS process info into the eventlogDuncan Coutts2011-05-261-0/+61
| | | | | The process ID, parent process ID, rts name and version The program arguments and environment.
* Fix Windows buildSimon Marlow2010-12-211-1/+1
|
* Implement stack chunks and separate TSO/STACK objectsSimon Marlow2010-12-151-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes two changes to the way stacks are managed: 1. The stack is now stored in a separate object from the TSO. This means that it is easier to replace the stack object for a thread when the stack overflows or underflows; we don't have to leave behind the old TSO as an indirection any more. Consequently, we can remove ThreadRelocated and deRefTSO(), which were a pain. This is obviously the right thing, but the last time I tried to do it it made performance worse. This time I seem to have cracked it. 2. Stacks are now represented as a chain of chunks, rather than a single monolithic object. The big advantage here is that individual chunks are marked clean or dirty according to whether they contain pointers to the young generation, and the GC can avoid traversing clean stack chunks during a young-generation collection. This means that programs with deep stacks will see a big saving in GC overhead when using the default GC settings. A secondary advantage is that there is much less copying involved as the stack grows. Programs that quickly grow a deep stack will see big improvements. In some ways the implementation is simpler, as nothing special needs to be done to reclaim stack as the stack shrinks (the GC just recovers the dead stack chunks). On the other hand, we have to manage stack underflow between chunks, so there's a new stack frame (UNDERFLOW_FRAME), and we now have separate TSO and STACK objects. The total amount of code is probably about the same as before. There are new RTS flags: -ki<size> Sets the initial thread stack size (default 1k) Egs: -ki4k -ki2m -kc<size> Sets the stack chunk size (default 32k) -kb<size> Sets the stack chunk buffer size (default 1k) -ki was previously called just -k, and the old name is still accepted for backwards compatibility. These new options are documented.
* Fix Windows memory freeing: add a check for fb == NULL; fixes trac #4506Ian Lynagh2010-12-081-40/+51
| | | | Also added a few comments, and a load of code got indented 1 level deeper.
* On Windows, when returning memory to the OS, we try to release itIan Lynagh2010-11-011-3/+87
| | | | as well as decommiting it.
* Whitespace only, in rts/win32/OSMem.cIan Lynagh2010-10-291-20/+20
|
* Replace some exit(n) calls with stg_exit(n); fixes trac #4445Ian Lynagh2010-10-281-4/+4
| | | | Also changed exitcode of -1 to 1 in hpc.
* Follow GHC.Bool/GHC.Types mergeIan Lynagh2010-10-231-2/+2
|
* Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4Edward Z. Yang2010-09-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | | This is patch that adds support for interruptible FFI calls in the form of a new foreign import keyword 'interruptible', which can be used instead of 'safe' or 'unsafe'. Interruptible FFI calls act like safe FFI calls, except that the worker thread they run on may be interrupted. Internally, it replaces BlockedOnCCall_NoUnblockEx with BlockedOnCCall_Interruptible, and changes the behavior of the RTS to not modify the TSO_ flags on the event of an FFI call from a thread that was interruptible. It also modifies the bytecode format for foreign call, adding an extra Word16 to indicate interruptibility. The semantics of interruption vary from platform to platform, but the intent is that any blocking system calls are aborted with an error code. This is most useful for making function calls to system library functions that support interrupting. There is no support for pre-Vista Windows. There is a partner testsuite patch which adds several tests for this functionality.
* errno corresponding to ERROR_NO_DATA should be EPIPE (non-threaded RTS)Simon Marlow2010-09-151-1/+10
|
* implement setThreadAffinity on Windows (#1741)Simon Marlow2010-09-141-2/+19
|
* Return memory to the OS; trac #698Ian Lynagh2010-08-131-0/+36
|
* Integrate new I/O manager, with signal supportJohan Tibell2010-07-242-4/+4
|
* Win32 getProcessElapsedTime: use a higher-resolution time sourceSimon Marlow2010-07-081-3/+27
| | | | | QueryPerformanceCounter() on Windows gives much better resolution than GetSystemTimeAsFileTime().
* Fix crash in non-threaded RTS on WindowsSimon Marlow2010-04-201-0/+5
| | | | | | | The tso->block_info field is now overwritten by pushOnRunQueue(), but stg_block_async_info was assuming that it still held a pointer to the StgAsyncIOResult. We must therefore save this value somewhere safe before putting the TSO on the run queue.
* Expand the scope of the event_buf_mutex to cover io_manager_eventSimon Marlow2010-04-201-15/+26
| | | | | I once saw a failure that I think was due to a race on io_manager_event, this should fix it.
* Make ioManagerDie() idempotentSimon Marlow2010-04-011-0/+4
| | | | | Avoids screeds of "event buffer overflowed; event dropped" in conc059(threaded1).
* avoid single quote in #errorSimon Marlow2010-03-301-1/+1
|
* Don't Terminate the ticker thread (#3748)Simon Marlow2010-01-271-6/+15
|
* Win32 yieldThread(): use SwitchToThread() instead of Sleep(0)Simon Marlow2010-01-271-1/+1
|
* fix warningsSimon Marlow2010-01-271-1/+1
|
* Windows DLLs: use DLL aware runSparks_closure instead of ↵Ben.Lippmeier@anu.edu.au2009-11-231-0/+3
| | | | base_GHCziConc_runSparks_closure directly
* Windows DLLs: remove dup symbol from def fileBen.Lippmeier@anu.edu.au2009-11-171-1/+0
|
* Windows DLLs: use one import lib for each DLL the RTS needs.Ben.Lippmeier@anu.edu.au2009-11-113-26/+34
|
* Break recursive imports between the RTS and base library on Windows.Ben.Lippmeier@anu.edu.au2009-11-061-0/+64
| | | | | | | | | | | The file rts/win32/libHSbase.def contains a list of all the symbols from the base library that the RTS needs. When building the RTS into a DLL on Windows, we want to link the DLL for the RTS before we link the DLL for the base library. We use libHSbase.def to make the "import library" libHSbase.so.a, which contains stubs for each of the symbols from the base library that the RTS needs.
* Windows-specific fix for #1185 patchSimon Marlow2009-11-121-1/+1
|
* Windows build fixesSimon Marlow2009-08-031-1/+1
|
* Windows build fixesSimon Marlow2009-08-034-7/+1
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-026-24/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* wibble in setExecutableAustin Seipp2009-03-201-1/+1
|
* Set thread affinity with +RTS -qa (only on Linux so far)Simon Marlow2009-03-181-0/+6
|
* Add getNumberOfProcessors(), FIX MacOS X build problem (hopefully)Simon Marlow2009-03-171-0/+14
| | | | | Somebody needs to implement getNumberOfProcessors() for MacOS X, currently it will return 1.
* avoid a crash: don't return unless the run queue has some threads in itSimon Marlow2009-03-111-6/+3
|
* Fix #2992: don't create a named eventSimon Marlow2009-03-111-1/+1
| | | | | | | Evidently I misread the docs for CreateEvent: if you pass a name to CreateEvent, then it creates a single shared system-wide Event with that name. So all Haskell processes on the machine were sharing the same Event object. duh.
* #2768: fix compatibility problem with newer version of mingwSimon Marlow2008-11-131-5/+1
|
* notice ^C exceptions when waiting for I/OSimon Marlow2008-11-132-0/+14
|
* Cope with ThreadRelocated when traversing the blocked_queueSimon Marlow2008-11-061-1/+16
| | | | Fixes "invalid what_next field" in ioref001 on Windows, and perhaps others
* Build fixes for DLLized rtsClemens Fruhwirth2008-10-131-0/+4
|
* FIX part of #2301, and #1619Simon Marlow2008-07-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* FIX BUILD on WindowsSimon Marlow2008-06-181-4/+4
|
* Reorganisation to fix problems related to the gct register variableSimon Marlow2008-04-161-1/+1
| | | | | | | | | - 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
* Make it less fatal to not call ioManagerStart()Simon Marlow2008-05-291-4/+4
| | | | For clients that forget to do hs_add_root()