Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] Cleanup within dll
From: Anthony Williams (anthony_at_[hidden])
Date: 2008-09-04 09:59:49


At Thu 04 Sep 2008 14:50:14 BST, Rudi Lindl <rudi.lindl_at_[hidden]> wrote:

> Thank you very much for your quick and your professional answer.

You're welcome.

> I want to avoid using the dll Version so I already got a workaround:
> i just use the DLL_THREAD_DETACH event within the DllMain function and call
> the cleanup stuff manually if the thread_specific_ptr.get() != Null
> this seems to work fine. Any objections?

That should work fine. Note that you might also want to do it in
DLL_PROCESS_DETACH, because the last thread out won't get a
DLL_THREAD_DETACH notification.

Also, you might like to try the trunk version of Boost.Thread --- I
made a fix to ensure that TlsFree is called to free the TLS slot, and
I think it may have fixed this issue as a consequence.

> Is there any FAQ for boost threads what works and what not? Something like
> does and don`ts? I think this would be quite usefull both for beginners and
> skilled people.

No there isn't. I can imagine that it would be useful. I'll write
something if I get time.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk