threading problems

RMH rmhlldr at yahoo.co.uk
Sun Aug 31 19:13:32 PDT 2003


Hello gentlemen,

I seem to have threading problems with 5.1-RELEASE. Every time I run
a multithreaded application (linked against libc_r) on a SMP system,
I get only 1 CPU loaded at any moment given. I tried different
software, including Viewperf, but results remain the same. When linked
against Linuxthreads, some applications work excellent, some segfault.
Here is some kind of a simple multithreaded program for a 2-way SMP
system that writes zeros to a memory array as fast as possible; it
runs fine with Linuxthreads or directly under Linux.

# gcc -O2 -fomit-frame-pointer -march=i686 -o smp smp.c -pthread
# ./smp
4Gb per pass mode

INTEGER | WRITING      8 Kb block: 1351 Mb/s
res0: 674
res1: 677

# gcc -O2 -fomit-frame-pointer -march=i686 -o smp2 smp.c -L/usr/local/lib
-llthread
# ./smp2
4Gb per pass mode

INTEGER | WRITING      8 Kb block: 2697 Mb/s
res0: 1349
res1: 1348

---
Regards,
 Rhett

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smp.c
Type: application/octet-stream
Size: 2240 bytes
Desc: smp.c
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20030901/d41168cc/smp.obj


More information about the freebsd-current mailing list