c++ with pthread?

Nicolas Blais nb_root at videotron.ca
Tue Nov 8 02:56:29 PST 2005


> 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 segfaults 
one of it's own very simple test code (thread2.cpp) :
http://www.gnu.org/software/commoncpp/docs/refman/html/thread2_8cpp-example.html

Either it's me, FreeBSD or the actual librairie that cause the segfault. I've 
even 'sent-pr' to update the port to the last version and it causes the same 
segfault.

gdb gives:

Starting program: /home/nicblais/test/cc/a.out
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...(no debugging symbols found)...(no debugging symbols 
found)...(no debugging symbols found)...(no debugging symbols 
found)...warning: Unable to get location for thread creation breakpoint: 
generic error
[New LWP 100180]
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
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 
-I/usr/local/include -L/usr/local/lib -lccext2 -lccgnu2 -L/usr/local/lib 
-lxml2 -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 
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? 
Licensing maybe? Technical?

Nicolas.
-- 
FreeBSD 7.0-CURRENT #0: Sat Nov  5 12:12:36 EST 2005     
root at clk01a:/usr/obj/usr/src/sys/CLK01A 
PGP? : http://www.clkroot.net/security/nb_root.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20051108/da9bd786/attachment.bin


More information about the freebsd-threads mailing list