jbaldwin / libcoro

C++20 coroutine library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

io_scheduler option to automatically run task_manager gc

jbaldwin opened this issue · comments

I ran into some issues while building the tcp echo/http 200 ok servers where if the ulimit -n was set to low the task_manager wouldn't destroy coroutines and thus the net::socket class would never calls close() in its destructor. I think it would be useful to allow the user to request an automatic cleanup (gc) at specific intervals to make sure resources are cleaned up automatically instead of forcing the user to call the garbage_collect() function manually.

Having a dedicated thread delete tasks is interesting, and caused a circular deadlock reference when it ended up self deleting itself. Leaving the design as is for now.