Subj : Re: Boost.Threads on its way to C++0x To : comp.programming.threads From : David Hopwood Date : Sat Apr 30 2005 11:26 pm Uenal Mutlu wrote: > "David Hopwood" wrote >>gottlobfrege@gmail.com wrote: >>>Ben Hutchings wrote: >>>>Peter Dimov wrote: >>>> >>>>>How do you solve the race condition WRT the hidden >>>>>compiler-generated boolean flag? >>>> >>>>You fix it in at the language level. [...] >>> >>>Yes, it should definitely be optional - you don't want the overhead for >>>all the cases where you know it is not needed. One of C++'s mantras I >>>believe... >> >>And as wrong-headed in this case as it is in many other cases. The >>compiler can tell which statics are guaranteed to only be accessed >>by a single thread (the graph of which functions potentially call >>each other that is needed to determine this, is also needed for other >>optimizations). > > True, but this can only work if threads are part of the core language. Yes, as they obviously should be anyway. The academic concurrent programming community has for 30 years been telling anyone who will listen that concurrency must be supported at the language level, but this view seems to be gaining a bit more traction recently, e.g. . -- David Hopwood .