OK, I will be the first to admit that I donβt know the increase, and more specifically raise :: asio from a hole in the ground, but I know what I heard about thread pools and workgroups.
Threads that must sleep until they are notified of a new job, but if they are not configured for this, they are likely to simply end the thread process and exit it. The sign of the control signal means that it is, a pool, a dream for a reasonable period of time before sending any work, and if the pool flows end, they do not wait properly. A quick look at the boost docs docs gave this , and it could be due to your problem.
In this note, is it possible that the destructor of your pool from the main () entry point, in fact, prematurely kills your working team? I see join_all, but this stop () gives me wills. if he does what his name implies, that would explain a lot. According to the description of the stop () call from the docs:
To complete the application shutdown, you must call the stop () function of the io_service object. This will result in a call to io_service run () to return as soon as possible, rejecting incomplete operations and without allowing ready-made handlers to be sent.
This immediate closing and leaving a mention seems suspiciously familiar with your current situation.
Again, I don't know boost: asio from Adam, but if I were on this, I would check the startup configuration for boost stream objects. they probably need to adjust how to get started, how to wait, etc. There should be many examples of using boost: asio on the Internet regarding the configuration of the very thing that you describe here, namely the work team paradigm. I see boost :: asio a TON on SO, so there are probably a lot of related or related questions.
Please feel free to lower this if it is of no use, and I apologize if that is the case.