Re: FreeBSD/i386 thread test

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Jeroen Ruigrok/asmodai" <asmodai(at)wxs(dot)nl>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: FreeBSD/i386 thread test
Date: 2003-09-08 17:07:27
Message-ID: 172170000.1063040847@lerlaptop-red.iadfw.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On Monday, September 08, 2003 12:50:18 -0400 Bruce Momjian
<pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:

> Jeroen Ruigrok/asmodai wrote:
>> -On [20030908 06:32], Bruce Momjian (pgman(at)candle(dot)pha(dot)pa(dot)us) wrote:
>> >> Your gethostbyname() is _not_ thread-safe
>> >> Your getpwuid() is _not_ thread-safe
>> >> Your functions are _not_ all thread-safe
>> >
>> > Interesting. Do you have all the *_r files listed in thread.c? I sure
>> > hope so. I assume you used the template thread compile flags for this
>> > test.
>>
>> Both gethostbyname() and getpwuid() have no _r equivalents on
>> FreeBSD-STABLE, ergo no thread-safe functions of these.
>
> So you don't have all the *_r functions, and your non-*_r functions
> aren't thread-safe. Should we disable theading on FreeBSD? Seems so.

Same is true on 5.1-CURRENT:
$ uname -a
FreeBSD lerlaptop-red.iadfw.net 5.1-CURRENT FreeBSD 5.1-CURRENT #51: Mon
Sep 8 05:52:15 CDT 2003
ler(at)lerlaptop(dot)lerctr(dot)org:/usr/obj/usr/src/sys/LERLAPTOP i386
$ ls -l test_t*
-rwxr-xr-x 1 ler ler 6689 Sep 3 16:40 test_thread
-rw------- 1 ler ler 3611 Sep 3 16:22 test_thread.c
-rw------- 1 ler ler 3638 Sep 3 19:01 test_thread2.c
$ cc -O -o test_thread2 test_thread2.c -lc_r
$ ./test_thread2
Your gethostbyname() is _not_ thread-safe
Your getpwuid() is _not_ thread-safe
Your functions are _not_ all thread-safe
$ man -k gethostbyname_r
gethostbyname_r: nothing appropriate
$ man -k getpwuid
getpwent(3), getpwent_r(3), getpwnam(3), getpwnam_r(3), getpwuid(3),
getpwuid_r(
3), setpassent(3), setpwent(3), endpwent(3) - password database operations
$

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Serguei Mokhov 2003-09-08 17:14:09 Re: mcxt.c
Previous Message Darko Prenosil 2003-09-08 16:58:23 Re: pgsql vc++|win32