-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TCP Stream Handler State Leak (#446)
* Fix TCP Stream Handler State Leak TCP stream handler state was never garbage collected on disconnect resulting in memory exhaustion after sufficient TCP life cycles. The following changes have been made to enable this garbage collection: * source/tcp now creates a special registration and token which corresponds to all stream handler events. * src/thread has been extended with a new `spawn2` function which operates as `spawn`, but takes an additional `mio::SetReadiness` which is flagged readable after the given closure returns control. * thread::Stoppable has been extended to include a new `ready` function which returns true when joining the given thread is guaranteed not block. `ready` always returns false on threads created with `spawn`. * Introduce ThreadPool Abstraction New abstraction captures notion of a thread pool, wrapping existing thread abstractions such that threads can by dynamically spawned, tracked, and garbage collected. Mutexes and Arcs are leveraged to ensure thread safety. * Guard Against None Values in join_ready. * Add Missing Count Functions to TokenSlab. Changes were missed in previous commits. * Remove StreamHandler.run and Clarify Comments. StreamHandler.run was no longer useful as ThreadPool encapsulates signaling when thread completion.
- Loading branch information
Showing
3 changed files
with
163 additions
and
40 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
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