Duncan Coutts pushed to branch wip/dcoutts/remove-signal-tickers-docs at Glasgow Haskell Compiler / GHC
Commits:
-
410748f3
by Duncan Coutts at 2026-05-10T16:47:32+01:00
-
a2bee349
by Duncan Coutts at 2026-05-10T16:47:41+01:00
4 changed files:
- changelog.d/dynamic-trace-flags
- + changelog.d/no-more-timer-signal
- docs/users_guide/profiling.rst
- docs/users_guide/runtime_control.rst
Changes:
| 1 | -section: compiler
|
|
| 1 | +section: rts
|
|
| 2 | 2 | synopsis: Support dynamic trace flags in RTS
|
| 3 | 3 | issues: #27186
|
| 4 | 4 | mrs: !15936
|
| 1 | +section: rts
|
|
| 2 | +synopsis: The RTS no longer uses signals for its interval timer
|
|
| 3 | +issues: #27073
|
|
| 4 | +mrs: !15757
|
|
| 5 | +description: {
|
|
| 6 | + Historically, on unix platforms, the RTS used a signal for its interval
|
|
| 7 | + timer. The interval timer is used for thread context switching amongst other
|
|
| 8 | + things. This would use either SIGVTALRM or SIGALRM. It was always somewhat
|
|
| 9 | + problematic: signals can cause system calls to be interrupted, the signal
|
|
| 10 | + must be disabled before forking a new process or the child process will also
|
|
| 11 | + receive the signals, and code executed within a signal handler is very
|
|
| 12 | + limited in what it can do.
|
|
| 13 | + |
|
| 14 | + Most unix platforms were already using other interval timer implementations.
|
|
| 15 | + In particular OSX and recent Linux were using thread-based timers. As of
|
|
| 16 | + this release, no platforms use a signal based interval timer. So it is no
|
|
| 17 | + longer necessary to mitigate the issues that arise. In particular the
|
|
| 18 | + `stopTimer` and `startTimer` RTS C functions (used by some libraries) are
|
|
| 19 | + now no-ops and are deprecated.
|
|
| 20 | +} |
| ... | ... | @@ -678,11 +678,11 @@ enclosed between ``+RTS ... -RTS`` as usual): |
| 678 | 678 | |
| 679 | 679 | Sets the interval that the RTS clock ticks at, which is also the sampling
|
| 680 | 680 | interval of the time and allocation profile. The default is 0.001 seconds
|
| 681 | - when profiling, and 0.01 otherwise. The runtime uses a single timer signal
|
|
| 682 | - to count ticks; this timer signal is used to control the context switch
|
|
| 681 | + when profiling, and 0.01 otherwise. The runtime uses a single timer event
|
|
| 682 | + to count ticks; this timer event is used to control the context switch
|
|
| 683 | 683 | timer (:ref:`using-concurrent`) and the heap profiling timer
|
| 684 | 684 | :ref:`rts-options-heap-prof`. Also, the time profiler uses the RTS timer
|
| 685 | - signal directly to record time profiling samples.
|
|
| 685 | + event directly to record time profiling samples.
|
|
| 686 | 686 | |
| 687 | 687 | Normally, setting the :rts-flag:`-V ⟨secs⟩` option directly is not
|
| 688 | 688 | necessary: the resolution of the RTS timer is adjusted automatically if a
|
| ... | ... | @@ -259,12 +259,6 @@ Miscellaneous RTS options |
| 259 | 259 | using the Haskell code as a DLL, and want to set your own signal
|
| 260 | 260 | handlers.
|
| 261 | 261 | |
| 262 | - Note that even with ``--install-signal-handlers=no``, the RTS
|
|
| 263 | - interval timer signal is still enabled. The timer signal is either
|
|
| 264 | - SIGVTALRM or SIGALRM, depending on the RTS configuration and OS
|
|
| 265 | - capabilities. To disable the timer signal, use the ``-V0`` RTS
|
|
| 266 | - option (see :rts-flag:`-V ⟨secs⟩`).
|
|
| 267 | - |
|
| 268 | 262 | .. rts-flag:: --install-seh-handlers=⟨yes|no⟩
|
| 269 | 263 | |
| 270 | 264 | If yes (the default), the RTS on Windows installs exception handlers to
|