mirrored from https://gitlab.haskell.org/ghc/ghc.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[project @ 2003-02-22 04:51:50 by sof]
Clean up code&interfaces that deals with timers and asynchrony: - Timer.{c,h} now defines the platform-independent interface to the timing services needed by the RTS. Itimer.{c,h} + win32/Ticker.{c,h} defines the OS-specific services that creates/destroys a timer. - For win32 plats, drop the long-standing use of the 'multimedia' API timers and implement the ticking service ourselves. Simpler and more flexible. - Select.c is now solely for platforms that use select() to handle non-blocking I/O & thread delays. win32/AwaitEvent.c provides the same API on the Win32 side. - support threadDelay on win32 platforms via worker threads. Not yet compiled up on non-win32 platforms; will do once checked in.
- Loading branch information
sof
committed
Feb 22, 2003
1 parent
d6b7d20
commit 557947d
Showing
20 changed files
with
373 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
/* ----------------------------------------------------------------------------- | ||
* $Id: Itimer.h,v 1.10 2001/11/27 01:51:23 sof Exp $ | ||
* $Id: Itimer.h,v 1.11 2003/02/22 04:51:51 sof Exp $ | ||
* | ||
* (c) The GHC Team 1998-2001 | ||
* | ||
* Interval timer for profiling and pre-emptive scheduling. | ||
* | ||
* ---------------------------------------------------------------------------*/ | ||
#ifndef __ITIMER_H__ | ||
#define __ITIMER_H__ | ||
|
||
# define TICK_FREQUENCY 50 /* ticks per second */ | ||
# define TICK_MILLISECS (1000/TICK_FREQUENCY) /* ms per tick */ | ||
extern int startTicker( nat ms ); | ||
extern int stopTicker ( void ); | ||
|
||
/* Context switch timing constants. Context switches happen after a | ||
* whole number of ticks, the default being every tick. | ||
*/ | ||
#define CS_MIN_MILLISECS TICK_MILLISECS /* milliseconds per slice */ | ||
|
||
int startVirtTimer( nat ms ); | ||
int stopVirtTimer ( void ); | ||
void block_vtalrm_signal ( void ); | ||
void unblock_vtalrm_signal ( void ); | ||
unsigned int getourtimeofday ( void ); | ||
extern void block_vtalrm_signal ( void ); | ||
extern void unblock_vtalrm_signal ( void ); | ||
extern unsigned int getourtimeofday ( void ); | ||
#endif /* __ITIMER_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.