Subj : Re: C++ desired features To : comp.lang.c++.moderated,comp.programming.threads From : Sergey P. Derevyago Date : Fri Feb 25 2005 10:11 pm Hans Boehm wrote: >> Well, what "shared data structures" you're talking about? >> > What do typical destructors do? > [snip] > > I find it hard to come up with a destructor that is useful and does not > access any shared data. (Of course the shared data might be in the > kernel.) > Do destructors modify some shared data? Yes they do! But what does the shared data mean in this context? That's the point! A destructor can issue a system call in order to free some system-shared resource. As the result, some system data structures will be (asynchronously) modified according to the request. The point is that it's the system which is obliged to protect the shared data. I.e. the destructor doesn't have to lock the access to this data so this data isn't considered as the shared data from the destructor's point of view. I.e. we can definitely assume that the shared data in question is the data that must be protected by locks owned by the application. -- 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! ] .