atom feed18 messages in org.freebsd.freebsd-threadspatch for threads/76690 - critical - ...
FromSent OnAttachments
Andriy TkachukMar 2, 2005 2:56 pm 
Daniel EischenMar 2, 2005 3:47 pm 
Andriy TkachukMar 3, 2005 6:35 am 
Daniel EischenMar 3, 2005 6:46 am 
David XuMar 3, 2005 6:48 am 
Andriy TkachukMar 3, 2005 6:58 am.patch
Andriy TkachukMar 3, 2005 7:29 am.cc
Andriy TkachukMar 3, 2005 8:07 am 
Andriy TkachukMar 3, 2005 8:10 am 
Andriy TkachukMar 3, 2005 8:15 am 
David XuMar 3, 2005 8:15 am 
Andriy TkachukMar 3, 2005 8:44 am 
Andriy TkachukMar 3, 2005 9:26 am.patch2
David XuMar 3, 2005 10:46 am 
Daniel EischenMar 3, 2005 3:14 pm 
Julian ElischerMar 3, 2005 8:29 pm 
David XuMar 4, 2005 3:24 am 
Andriy TkachukMar 4, 2005 5:57 am 
Subject:patch for threads/76690 - critical - fork hang in child for-lc_r
From:Andriy Tkachuk (and@ukr.net)
Date:Mar 3, 2005 7:29:59 am
List:org.freebsd.freebsd-threads
Attachments:
test2.cc - 1k

But if one wants to use pure user threads on his UP system, what he will chose if not libc_r ?

And i have some test program with shows the better results for libc_r than for libpthreads. Take a look.

The program is the 500 threads, each of them allocate memory in loop and then free it in another loop. Program outputs the time consumed for this two loops.

See the results.

./a.out m 1000 10 # 1000 iterations, malloc by 10 bytes memory

chanks thread 0 created thread 1 created thread 2 created thread 3 created ... thread 499 created 0.000870 0.000544 0.000695 0.000594 0.000913 ... (after some time, say 10-20 seconds, there is stable picture: ) 0.001056 0.000756 0.000485 0.000476 0.000528 0.000479 0.000550 0.000481 0.000561 0.000541 0.000483 0.000558 0.000482 0.000561 0.000532 0.000479 0.000551 0.000484 0.000923 0.001180 0.000981 0.000492 0.000996 0.000536 0.000975 0.000534

this is for libc_r. Let's see what about lpthreads.

c++ -lpthread test2.cc ./a.out m 1000 10

thread 0 created thread 1 created ... thread 498 created thread 499 created 0.001704 0.001707 0.001671 0.001683 0.001691 0.001664 0.001661 0.001683 0.001709 ... 0.001643 0.002018 0.001668 0.001672 0.001744 0.001689 0.001672 0.001682 0.001643 0.001687 0.001670 0.001692 0.001677 0.001732 0.001650 0.001685 0.001678 0.001685 1.303800 5.266314 5.268821 5.268158 5.268539 5.268644 5.268515 5.268963 5.269147 5.268968 5.268928 ... 5.341573 5.341051 5.341417 5.341327 5.341084 5.340510 5.340974 5.340914 5.341118 ...

So what? The test2.cc is attached.

(of course all was done on current:

uname -a

FreeBSD fbsd 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Tue Mar 1 16:03:09 IST 2005 ant@fbsd:/usr/obj/usr/src/sys/FBSD i386 )

Is there a reason you are still using libc_r?

I don't use it at all, but there was critical bug i threads-pr - so i just decided to fix it since i have had some time )

If this library is needless, why is it still there and this pr in criticals?