71d Subj : Re: C++ desired features To : comp.lang.c++.moderated,comp.programming.threads From : Sergey P. Derevyago Date : Thu Feb 24 2005 04:30 pm Hans Boehm wrote: > > As a rule, thoroughly designed MT set of fully independent threads which > > communicate via the message queues. The synchronization primitives are > > used inside these queues and virtually no locks are supposed outside the > > queues. > > > If that's possible, great. For the problems I've dealt with, the > problems usually aren't quite independent. And destructors especially > tend to involve shared data structures, since their job is typically to > return something to a shared resource pool. You can sometimes keep the > resource pools per thread, but that incurs other substantial risks. > Well, what "shared data structures" you're talking about? The point is that in well-designed application the data structures being modified from several threads simultaneously are pretty rare. That is typical destructor doesn't modify thread-shared data so it doesn't lock anything. IMHO if reasonably good "MT-friendly" GC can ever be created for C/C++ languages it doesn't have to be fully transparent and ready to deal with every possible application design. MT programming is really hard and no one should assume that such a complex (asynchronous) subsystem can just be thrown into the application. This GC must clearly define the contract (w.r.t. the application) and the application has to be designed for this particular GC from the very beginning. -- With all respect, Sergey. http://ders.angen.net/ mailto : ders at skeptik.net [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] . 0