head	1.8;
access;
symbols
	REL7_4_29:1.3
	REL8_0_25:1.4
	REL8_1_21:1.7
	REL7_4_28:1.3
	REL8_0_24:1.4
	REL8_1_20:1.7
	REL7_4_27:1.3
	REL8_0_23:1.4
	REL8_1_19:1.7
	REL7_4_26:1.3
	REL8_0_22:1.4
	REL8_1_18:1.7
	REL7_4_25:1.3
	REL8_0_21:1.4
	REL8_1_17:1.7
	REL7_4_24:1.3
	REL8_0_20:1.4
	REL8_1_16:1.7
	REL7_4_23:1.3
	REL8_0_19:1.4
	REL8_1_15:1.7
	REL7_4_22:1.3
	REL8_0_18:1.4
	REL8_1_14:1.7
	REL7_4_21:1.3
	REL8_0_17:1.4
	REL8_1_13:1.7
	REL7_4_20:1.3
	REL8_0_16:1.4
	REL8_1_12:1.7
	REL7_4_19:1.3
	REL8_0_15:1.4
	REL8_1_11:1.7
	REL7_4_18:1.3
	REL8_0_14:1.4
	REL8_1_10:1.7
	REL7_4_17:1.3
	REL8_0_13:1.4
	REL8_1_9:1.7
	REL8_0_12:1.4
	REL8_1_8:1.7
	REL7_4_16:1.3
	REL8_0_11:1.4
	REL8_1_7:1.7
	REL8_0_10:1.4
	REL8_1_6:1.7
	REL7_4_15:1.3
	REL8_1_5:1.7
	REL8_0_9:1.4
	REL7_4_14:1.3
	REL7_4_13:1.3
	REL8_0_8:1.4
	REL8_1_4:1.7
	REL7_4_12:1.3
	REL8_0_7:1.4
	REL8_1_3:1.7
	REL7_4_11:1.3
	REL8_0_6:1.4
	REL8_1_2:1.7
	REL7_4_10:1.3
	REL8_0_5:1.4
	REL8_1_1:1.7
	REL8_1_STABLE:1.7.0.2
	REL8_1_0:1.7
	REL8_1_0RC1:1.7
	REL8_1_0BETA4:1.7
	REL8_1_0BETA3:1.7
	REL7_4_9:1.3
	REL8_0_4:1.4
	REL8_1_0BETA2:1.7
	REL8_1_0BETA1:1.7
	REL7_4_8:1.3
	REL8_0_3:1.4
	REL8_0_2:1.4
	REL7_4_7:1.3
	REL8_0_1:1.4
	REL8_0_STABLE:1.4.0.4
	REL8_0_0:1.4.0.2
	REL8_0_0RC5:1.4
	REL8_0_0RC4:1.4
	REL8_0_0RC3:1.4
	REL8_0_0RC2:1.4
	REL8_0_0RC1:1.4
	REL8_0_0BETA5:1.4
	REL8_0_0BETA4:1.4
	REL7_4_6:1.3
	REL8_0_0BETA3:1.4
	REL8_0_0BETA2:1.4
	REL7_4_5:1.3
	REL7_4_4:1.3
	REL8_0_0BETA1:1.4
	REL7_4_3:1.3
	REL7_4_2:1.3
	REL7_4_1:1.3
	REL7_4:1.3
	REL7_4_RC2:1.3
	REL7_4_STABLE:1.3.0.2
	REL7_4_RC1:1.3
	REL7_4_BETA5:1.3
	REL7_4_BETA4:1.3;
locks; strict;
comment	@# @;


1.8
date	2006.02.04.01.00.02;	author momjian;	state dead;
branches;
next	1.7;

1.7
date	2005.08.23.21.02.05;	author momjian;	state Exp;
branches;
next	1.6;

1.6
date	2005.08.23.20.48.47;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2005.08.23.20.45.11;	author momjian;	state Exp;
branches;
next	1.4;

1.4
date	2004.04.23.18.15.55;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	2003.09.27.17.29.30;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	2003.09.27.16.24.45;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2003.09.27.15.32.48;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.8
log
@Move thread_test directory from /tools to /test so source-only tarballs
have the directory for the configure test.
@
text
@This program should be run by developers wishing to enable threading on
new platforms.

Run thread_test program to determine if your native libc functions are
thread-safe, or if we should use *_r functions or thread locking.

To use this program, you must:

	o run "configure --enable-thread-safety"
	o compile the main source tree
	o compile and run this program

If your platform requires special thread flags that are not tested by
/config/acx_pthread.m4, add PTHREAD_CFLAGS and PTHREAD_LIBS defines to 
your template/${port} file.

Windows Systems
===============

Windows systems do not vary in their thread-safeness in the same way that
other systems might, nor do they generally have pthreads installed, hence 
on Windows this test is skipped by the configure program (pthreads is 
required by the test program, but not PostgreSQL itself). If you do wish
to test your system however, you can do so as follows:

1) Install pthreads in you Mingw/Msys environment. You can download pthreads
   from ftp://sources.redhat.com/pub/pthreads-win32/.
   
2) Build the test program:

   gcc -o thread_test.exe \
    -D_REENTRANT \
    -D_THREAD_SAFE \
    -D_POSIX_PTHREAD_SEMANTICS \
    -I../../../src/include/port/win32 \
    thread_test.c \
    -lwsock32 \
    -lpthreadgc2

3) Run thread_test.exe. You should see output like:

    dpage@@PC30:/cvs/pgsql/src/tools/thread$ ./thread_test
    Your GetLastError() is thread-safe.
    Your system uses strerror() which is thread-safe.
    getpwuid_r()/getpwuid() are not applicable to Win32 platforms.
    Your system uses gethostbyname which is thread-safe.

    Your platform is thread-safe.

@


1.7
log
@The attached patch updates the thread test program to run stand-alone on
Windows. The test itself is bypassed in configure as discussed, and
libpq has been updated appropriately to allow it to build in thread-safe
mode.

Dave Page
@
text
@@


1.6
log
@Back out incorrect commit.
@
text
@d17 33
@


1.5
log
@Fix function name.
@
text
@a16 33
Windows Systems
===============

Windows systems do not vary in their thread-safeness in the same way that
other systems might, nor do they generally have pthreads installed, hence 
on Windows this test is skipped by the configure program (pthreads is 
required by the test program, but not PostgreSQL itself). If you do wish
to test your system however, you can do so as follows:

1) Install pthreads in you Mingw/Msys environment. You can download pthreads
   from ftp://sources.redhat.com/pub/pthreads-win32/.
   
2) Build the test program:

   gcc -o thread_test.exe \
    -D_REENTRANT \
    -D_THREAD_SAFE \
    -D_POSIX_PTHREAD_SEMANTICS \
    -I../../../src/include/port/win32 \
    thread_test.c \
    -lwsock32 \
    -lpthreadgc2

3) Run thread_test.exe. You should see output like:

    dpage@@PC30:/cvs/pgsql/src/tools/thread$ ./thread_test
    Your GetLastError() is thread-safe.
    Your system uses strerror() which is thread-safe.
    getpwuid_r()/getpwuid() are not applicable to Win32 platforms.
    Your system uses gethostbyname which is thread-safe.

    Your platform is thread-safe.

@


1.4
log
@Add new auto-detection of thread flags.

Allow additional thread flags to be added via port templates.

Change thread flag names to PTHREAD_CFLAGS and PTHREAD_LIBS to match new
configure script.
@
text
@d17 33
@


1.3
log
@Add compile step to instructions.
@
text
@a8 3
	o add "THREAD_SUPPORT=yes" to your template/${port} file 
	o add any THREAD_CPPFLAGS and THREAD_LIBS defines to your
	  template/${port} file
d12 5
@


1.2
log
@Finalize configuration of thread_test program.
@
text
@d13 1
@


1.1
log
@Rename thread compile flag.  Move thread test program to tools/thread,
and improve tests.
@
text
@d7 7
a13 2
Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'
defines to your template/${port} file before compiling this program.
@

