From owner-freebsd-hackers Thu Nov 9 13:10:50 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp.tor3.targetnet.com (smtp.tor3.targetnet.com [207.176.132.71]) by hub.freebsd.org (Postfix) with ESMTP id E816337B4C5 for ; Thu, 9 Nov 2000 13:10:45 -0800 (PST) Received: from james by smtp.tor3.targetnet.com with local (Exim 3.16 #1) id 13tyy5-000BPX-00 for hackers@freebsd.org; Thu, 09 Nov 2000 16:10:45 -0500 Date: Thu, 9 Nov 2000 16:10:45 -0500 From: James FitzGibbon To: hackers@freebsd.org Subject: Repeatable STL core with -pthread Message-ID: <20001109161045.D39548@targetnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: Targetnet.com Inc. Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG We're having a problem with threaded programs that use the STL. Given the following program: --START-- #include #include typedef map mymap_t; #ifdef GLOBLOCK pthread_mutex_t glob_mut; #endif void *run(void *) { while (1) { string f(""); #ifdef GLOBLOCK pthread_mutex_lock(&glob_mut); #endif f += "adsasd"; f += "adsasd"; f += "adsasd"; #ifdef GLOBLOCK pthread_mutex_unlock(&glob_mut); #endif } } int main () { #define FOO 50 pthread_t thread[FOO]; for(int x =0;x