summaryrefslogtreecommitdiff
path: root/rts/win32/AsyncIO.c
Commit message (Collapse)AuthorAgeFilesLines
* winio: Multiple refactorings and support changes.Tamar Christina2020-07-151-384/+0
|
* rts: Add more debug output to failed path in onIOCompleteBen Gamari2020-02-141-2/+3
| | | | This will help track down #17035.
* Prefer #if defined to #ifdefBen Gamari2017-04-281-1/+1
| | | | Our new CPP linter enforces this.
* rts/win32/IOManager: Fix integer typesBen Gamari2016-12-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code has been broken on 64-bit systems for some time: the length and timeout arguments of `addIORequest` and `addDelayRequest`, respectively, were declared as `int`. However, they were passed Haskell integers from their respective primops. Integer overflow and madness ensued. This resulted in #7325 and who knows what else. Also, there were a few left-over `BOOL`s in here which were not passed to Windows system calls; these were changed to C99 `bool`s. However, there is still a bit of signedness inconsistency within the `delay#` call-chain, * `GHC.Conc.IO.threadDelay` and the `delay#` primop accept `Int` arguments * The `delay#` implementation in `PrimOps.cmm` expects the timeout as a `W_` * `AsyncIO.c:addDelayRequest` expects an `HsInt` (was `int` prior to this patch) * `IOManager.c:AddDelayRequest` expects an `HsInt`` (was `int`) * The Windows `Sleep` function expects a `DWORD` (which is unsigned) Test Plan: Validate on Windows Reviewers: erikd, austin, simonmar, Phyx Reviewed By: Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2861 GHC Trac Issues: #7325
* Use C99's boolBen Gamari2016-11-291-3/+3
| | | | | | | | | | | | Test Plan: Validate on lots of platforms Reviewers: erikd, simonmar, austin Reviewed By: erikd, simonmar Subscribers: michalt, thomie Differential Revision: https://phabricator.haskell.org/D2699
* Revert "rts: add Emacs 'Local Variables' to every .c file"Simon Marlow2014-09-291-8/+0
| | | | This reverts commit 39b5c1cbd8950755de400933cecca7b8deb4ffcd.
* Fix variable name typo from commit 3021fbNiklas Larsson2014-07-301-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* 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>
* rts: delint/detab/dewhitespace win32/AsyncIO.cAustin Seipp2014-07-281-150/+166
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Use usecs rather than msecs for microsecondsIan Lynagh2013-02-051-3/+3
| | | | We were using "us" elsewhere, so this was inconsistent.
* 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 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.
* Windows build fixesSimon Marlow2009-08-031-1/+0
|
* 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
* FIX BUILD on WindowsSimon Marlow2008-06-181-4/+4
|
* On Windows, Delete the CriticalSection's we InitializeIan Lynagh2007-11-251-0/+1
|
* FIX #1177, partially at least.Simon Marlow2007-07-251-2/+2
| | | | | | | | | | | 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.
* Remove the Windows Async IO Manager completely in THREADED_RTS modeSimon Marlow2006-12-011-0/+4
| | | | | It isn't used here anyway, just making sure the code doesn't get compiled in.
* 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.
* Free Win32 Handles on shutdownSimon Marlow2006-08-251-3/+14
| | | | patch from #878
* Remove few format-warnings by adding castsEsa Ilari Vuokko2006-08-131-2/+2
|
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+345
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.