This is boost asio behavior. when join is called no more work is created and once all threads coalesce the join unblocks. Nothing can force a thread to stop, unless you want state corruption and arbitrary behavior. For threads under the control of zeromq workers in server, a zmq signal is sent which causes the thread to terminate when not busy.
(edited)