There was a busy loop in the thread that ran the http server while waiting for a shutdown signal. This would cause the app to use 100% of two CPU cores while it was running.
This replaced the thread with two, one that will wait for the shutdown signal, and one that will run the server, and it uses the unblock() feature of the tiny_http server to gracefully shutdown the server when we get the shutdown signal.
There was a busy loop in the thread that ran the http server while waiting for a shutdown signal. This would cause the app to use 100% of two CPU cores while it was running.
This replaced the thread with two, one that will wait for the shutdown signal, and one that will run the server, and it uses the
unblock()
feature of thetiny_http
server to gracefully shutdown the server when we get the shutdown signal.