Commit a520761d authored by Yuras's avatar Yuras Committed by Austin Seipp

Remove outdated TODO in TimeManager

It describes a work around Trac #3838, but it is already fixed and the
workaround removed, Trac #7653

Test Plan: not needed

Reviewers: hvr, Mikolaj, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision:
parent d997ca85
......@@ -81,32 +81,6 @@ data State = Created
-- | A priority search queue, with timeouts as priorities.
type TimeoutQueue = Q.PSQ TimeoutCallback
Instead of directly modifying the 'TimeoutQueue' in
e.g. 'registerTimeout' we keep a list of edits to perform, in the form
of a chain of function closures, and have the I/O manager thread
perform the edits later. This exist to address the following GC
Since e.g. 'registerTimeout' doesn't force the evaluation of the
thunks inside the 'emTimeouts' IORef a number of thunks build up
inside the IORef. If the I/O manager thread doesn't evaluate these
thunks soon enough they'll get promoted to the old generation and
become roots for all subsequent minor GCs.
When the thunks eventually get evaluated they will each create a new
intermediate 'TimeoutQueue' that immediately becomes garbage. Since
the thunks serve as roots until the next major GC these intermediate
'TimeoutQueue's will get copied unnecessarily in the next minor GC,
increasing GC time. This problem is known as "floating garbage".
Keeping a list of edits doesn't stop this from happening but makes the
amount of data that gets copied smaller.
TODO: Evaluate the content of the IORef to WHNF on each insert once
this bug is resolved:
-- | An edit to apply to a 'TimeoutQueue'.
type TimeoutEdit = TimeoutQueue -> TimeoutQueue
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment