From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17574 invoked by alias); 13 Apr 2005 16:56:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17412 invoked by uid 48); 13 Apr 2005 16:56:17 -0000 Date: Wed, 13 Apr 2005 16:56:00 -0000 Message-ID: <20050413165617.17411.qmail@sourceware.org> From: "dhruvbird at yahoo dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040114172507.13684.evijaykumar@yahoo.com> References: <20040114172507.13684.evijaykumar@yahoo.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13684] local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg01745.txt.bz2 List-Id: ------- Additional Comments From dhruvbird at yahoo dot com 2005-04-13 16:56 ------- (In reply to comment #19) > I want to emphasize here again one principle of C and C++: Trust the > programmers, and allow them to do low-level tunings for performance. Or what is > the purpose of C++ (when compared with "high-level" languages like Python)? > This "fix" rid the programmers of their right to choose the way they want. > > Unless the future C++ standard demands protection in such cases, I do not think > the compiler-provided mechanism a good idea. I would agree with you. Btw, what is the approach adopted in case the app. is a single threaded one? Are the locks still taken in this case? Also, if it is an mt-app. but the programmer is sure that that particula function will NOT be reentrant, why should he pay the penalty of a lock or/and a check every time the function is called? Stroustrup continuously emphasised that C++ was designed to be as fast if not faster than C in most respects, and I guess that's why C++ is gaining popularity. If it were to use the java approach then it would be just another bloat-language.... -Dhruv. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13684