chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.97k stars 1.22k forks source link

No way to monitor backups in scheduler #1557

Open Tasty213 opened 1 week ago

Tasty213 commented 1 week ago

Hi,

I think a program i'm writing has a problem executing tasks submitted to a io_context quickly enough. In particular the program runs fine but over a long period of time it appears that some tasks are never executed after being submitted for execution leading to an eventual crash as the program thinks it's been disconnected from the rest of the system. I can see that there's a boost::asio::execution::outstanding_work property that i can access but i can't actually retrieve the value from it.

Is there any way to periodically report how many tasks a IO Context has on its queue to execute so i can determine if there is some sort of backup concurring?

Thanks in advance

101wave commented 1 week ago

I am new to C++ and I guess I should extend the life cycle of the session, similar to pseudo-closure