$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] ASIO Win32 Thread not terminated
From: michi7x7 (mailing-lists_at_[hidden])
Date: 2010-09-15 10:14:20
Hi manuel,
> You're right, the number of threads doesn't increase when I create more clients.
> Still, I'd like to know when these threads terminate. Do they nescessarily run until the app exits, or is there a way of telling asio 'hey, I'm done with sockets now, no need to keep these threads running'.
>
i think the threads are terminated when the destructor of the io_service
is called. Creating threads is too expensive, to kill them everytime the
program is idle. So they are usually left in a blocked state.
You can try this by putting an iostream into brackets {} and set a
breakpoint afterwards.
If the threads are still running, they might be killed using an old
C-technique, called atexit().
Regards, michi7x7