From owner-freebsd-threads@FreeBSD.ORG Tue Nov 8 10:56:29 2005 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45FF416A458 for ; Tue, 8 Nov 2005 10:56:29 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD55543D48 for ; Tue, 8 Nov 2005 10:56:28 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from clk01a ([66.130.198.54]) by VL-MO-MR001.ip.videotron.ca (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTP id <0IPM0048RUBCIIA0@VL-MO-MR001.ip.videotron.ca> for freebsd-threads@freebsd.org; Tue, 08 Nov 2005 05:54:48 -0500 (EST) Date: Tue, 08 Nov 2005 05:54:43 -0500 From: Nicolas Blais In-reply-to: <000701c5e432$fb600980$4801a8c0@ws-ew-3.demig.intra> To: freebsd-threads@freebsd.org Message-id: <200511080554.48373.nb_root@videotron.ca> MIME-version: 1.0 Content-type: multipart/signed; boundary=nextPart5418983.vW4Y3AATdm; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-transfer-encoding: 7bit References: <000701c5e432$fb600980$4801a8c0@ws-ew-3.demig.intra> User-Agent: KMail/1.8.3 Cc: Norbert Koch Subject: Re: c++ with pthread? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2005 10:56:29 -0000 --nextPart5418983.vW4Y3AATdm Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > Commoncpp tries to be platform-independent. So, no. > What performance are you talking about? Thread creation > may be slower, but context changes are always handled by > pthread. So there would be no difference. > Mutexes and conditionals will be slower too. > I never ran any benchmarks. Actually, I've run into a decision forcing event with commoncpp. It segfaul= ts=20 one of it's own very simple test code (thread2.cpp) : http://www.gnu.org/software/commoncpp/docs/refman/html/thread2_8cpp-example= =2Ehtml Either it's me, FreeBSD or the actual librairie that cause the segfault. I'= ve=20 even 'sent-pr' to update the port to the last version and it causes the sam= e=20 segfault. gdb gives: Starting program: /home/nicblais/test/cc/a.out (no debugging symbols found)...(no debugging symbols found)...(no debugging= =20 symbols found)...(no debugging symbols found)...(no debugging symbols=20 found)...(no debugging symbols found)...(no debugging symbols=20 found)...warning: Unable to get location for thread creation breakpoint:=20 generic error [New LWP 100180] (no debugging symbols found)...(no debugging symbols found)...(no debugging= =20 symbols found)...starting father thread starting child thread child start father end child end [New Thread 0x8057600 (LWP 100180)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x8057600 (LWP 100180)] 0x280d4c95 in ost::Thread::close () from /usr/local/lib/libccgnu2-1.3.so.1 from thread2.cpp compile like so: gcc -I/usr/local/include/cc++2 -D_THREAD_SAFE -D_GNU_SOURCE=20 =2DI/usr/local/include -L/usr/local/lib -lccext2 -lccgnu2 -L/usr/local/lib= =20 =2Dlxml2 -lz -L/usr/local/lib -liconv -lm -lz -pthread thread2.cpp Since the actual fault is in libccgnu2, I've submitted a bug report on=20 sourceforge. Sadly enough, this situation has cause me to stay with pthread so far. About ptmalloc2, is the reason it wasn't implemented a compatibility issue= ?=20 Licensing maybe? Technical? Nicolas. =2D-=20 =46reeBSD 7.0-CURRENT #0: Sat Nov 5 12:12:36 EST 2005 =20 root@clk01a:/usr/obj/usr/src/sys/CLK01A=20 PGP? : http://www.clkroot.net/security/nb_root.asc --nextPart5418983.vW4Y3AATdm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBDcIP4z38ton5LGeIRAmpcAKCCS26KPGmPxRKrLJuknpxRPYdCgACgl6ou FESQGSg6PrWMmXbp2F1+i8w= =bcZs -----END PGP SIGNATURE----- --nextPart5418983.vW4Y3AATdm--