From stdcxx-dev-return-1811-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Tue Jul 25 20:39:45 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 62803 invoked from network); 25 Jul 2006 20:39:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Jul 2006 20:39:45 -0000 Received: (qmail 39302 invoked by uid 500); 25 Jul 2006 20:39:45 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 39290 invoked by uid 500); 25 Jul 2006 20:39:45 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 39279 invoked by uid 99); 25 Jul 2006 20:39:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2006 13:39:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2006 13:39:43 -0700 Received: from qxvcexch01.ad.quovadx.com (qxvcexch01.ad.quovadx.com [192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.4) with ESMTP id k6PKdIxc018343 for ; Tue, 25 Jul 2006 20:39:19 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 25 Jul 2006 14:39:23 -0600 Message-ID: <44C6819D.9080303@roguewave.com> Date: Tue, 25 Jul 2006 14:39:57 -0600 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: string methods thread safety References: <44BC2FEB.7040801@roguewave.com> In-Reply-To: <44BC2FEB.7040801@roguewave.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Jul 2006 20:39:23.0758 (UTC) FILETIME=[69D8F8E0:01C6B02A] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Martin Sebor wrote: > Farid Zaripov wrote: > >> > > [...] > >> In the test below correct output does the first thread only (prints >> "str1") and >> this result depends from OS, CPU power etc. > > > Okay, that's because the thr_arg array goes out of scope after > run_test returns. I agree that the thread should be able to safely > access the argument in this case. But I don't think the problem is > limited to the thread argument; it affects the thread id as well > (the address of the thread id is passed to the thread function when > the argument array is null). Let me look into changing it as well. On second thought, I don't think we want to change the thread id case. So I'll apply your originally proposed patch. Martin