Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO Win32 Thread not terminated
From: Manuel Drews (manuel.drews_at_[hidden])
Date: 2010-09-15 09:41:30


Hi Igor,

thanx for the fast answer!

-------- Original-Nachricht --------
> Datum: Wed, 15 Sep 2010 14:24:18 +0200
> Von: Igor R <boost.lists_at_[hidden]>
> An: boost-users_at_[hidden]
> Betreff: Re: [Boost-users] ASIO Win32 Thread not terminated

> > if I run the example boost_asio/example/http/client/async_client.cpp on
> a Windows 7 or Vista and set a breakpoint on the very last line (return
> 0;), VisualStudio tells me that (apart from the Main Thread) two Threads named
> Win32 Thread are still running.
>
> These are internal asio threads.
>
> > My concern is, that a project which uses a lot of socket connections
> will end up with a dozen or more lingering threads. How can I avoid that?
>
> No, AFAIK, the amount of these internal threads doesn't depend on the
> count of open sockets. You can open and close sockets/timers and see
> that you still have these 2 additional threads.

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'.

Thanx!

manuel

> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net