Add thread.c and linkage

Started by Bruce Momjianabout 23 years ago5 messagespatches
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Here is a new file, threads.c, which implements the functions needed for
libpq threading.

One tricky part was to add the threading flags to the compile of just
thread.c. I used:

# compile this with thread flags
thread.o: thread.c
$(CC) $(CFLAGS) $(THREAD_CFLAGS) -c thread.c

I assume that is the correct way to do it.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+182-40
/pg/port/threads.ctext/plainDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: Add thread.c and linkage

It seems really ugly to be putting a big case statement on the OS type
into configure. Can't you put those values into the per-platform
template files, instead?

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: Add thread.c and linkage

Tom Lane wrote:

It seems really ugly to be putting a big case statement on the OS type
into configure. Can't you put those values into the per-platform
template files, instead?

I hadn't thought of that. We can do that. However, seems we have to
have a test in there anyway to know whether we can do threads at all, or
do we make a new variable and set it to true only in the templates that
support it?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: Add thread.c and linkage

Bruce Momjian <pgman@candle.pha.pa.us> writes:

do we make a new variable and set it to true only in the templates that
support it?

That's what I'd suggest.

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: Add thread.c and linkage

Done.

---------------------------------------------------------------------------

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

do we make a new variable and set it to true only in the templates that
support it?

That's what I'd suggest.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+91-63