Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manager culling thread could use a cull and merge method #1

Open
rlupton20 opened this issue Jul 20, 2016 · 0 comments
Open

Manager culling thread could use a cull and merge method #1

rlupton20 opened this issue Jul 20, 2016 · 0 comments

Comments

@rlupton20
Copy link
Owner

rlupton20 commented Jul 20, 2016

Currently when a Manager thread spawns a submanager, there is a thread which runs along the list of submanagers, and cleans out the finished ones (this list is maintained, so in the event of an exception we can clean up the threads).

Currently the list of threads is made threadsafe by being kept inside a TVar (i.e. it uses software transaction memory). It also retry's on unbounded many submanagers, which is bad. This wasn't considered an issue, since there shouldn't be too much submanager churn.

A better approach would be, as in warp's timeout thread, use a list protected by an IORef, swap it out for an empty list (to which new submanagers can be added), trim the finished submanagers, and then merge them back in to the IORef'd list.

It would also be a good opportunity to improve the unit testing of the Manager submodule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant