Re: threads stuff/UnixWare - Mailing list pgsql-hackers

From Larry Rosenman
Subject Re: threads stuff/UnixWare
Date
Msg-id A922ABBBF0DBFDBEF5B29304@lerlaptop.lerctr.org
Whole thread Raw
In response to Re: threads stuff/UnixWare  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: threads stuff/UnixWare  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers

--On Wednesday, May 12, 2004 21:55:40 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

> Larry Rosenman wrote:
>> > [ Sorry I have been away from email today. ]
>> >
>> > Larry, now that I have put the thread testing into configure, I am
>> > ready to deal with Unixware.  In fact I posted to the list asking you
>> > about it but was too lazy to look up your email address.
>> >
>> > Anyway, I think the only solution is going to be to use the -K flag on
>> > all compiles on that platform if you want threads, so anything that
>> > uses libpq will need it.  We don't have a client-level flags option at
>> > this point, but we can add it, or just the flag for the backend
>> > compile too.
>> I think a client-level flag would be best, that way the backend doesn't
>> get the wrapped functions from libthread.
>>
>> Can you do the patch?
>
> OK.  Can someone think of a clean way to add a flag to everything but
> the backend build?  Hold, what about /port.  Larry, if we compile
> anything with threads does everything that links with that object file
> require the flag, even if there are no thread flags in the object file?
> I don't think so, but I am just checking.  Actually, my bet is that it
> might do that because if it didn't, there would be no problem with using
> that flag on the backend because there are no threading calls in there.
Yes, there would still be the overhead, because the functions that
libthread wraps would go through that overhead since libthread does it's
magic at _ini time.

Y'all were concerned with overhead in previous discussions.

If you want to link the backend with -Kpthread, you can, but basically the
client code (initdb, et al) should be -Kpthread, and the backend should NOT
since there are no threads calls in the backend.

>
> I am afraid of libpgport.  Those object files get used by the backend,
> and by the client stuff.  Larry can -K and non-K object files be mixed
> in the same binary?
Yes, they can.

But, you MUST link ANY pthread_* using code with -K pthread.

See above discussion.




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

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: threads stuff/UnixWare
Next
From: Tom Lane
Date:
Subject: Re: Subtle pg_dump problem...