Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 93407d3

Browse files
committed
Use SYSV semaphores rather than POSIX on Darwin >= 6.0 (i.e., OS X 10.2
and up), per Chris Marcellino. This avoids consuming O(N^2) file descriptors to support N backends. Tests suggest it's about a wash for small installations, but large ones would have a problem.
1 parent f828f87 commit 93407d3

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/template/darwin

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
# $PostgreSQL: pgsql/src/template/darwin,v 1.10 2006/03/11 04:38:40 momjian Exp $
1+
# $PostgreSQL: pgsql/src/template/darwin,v 1.11 2007/09/26 00:32:46 tgl Exp $
22

33
# Apple's cpp-precomp seems a tad broken, so don't use it
44
# (Note: on OS X before 10.2, you might need -traditional-cpp instead)
55
CC="$CC -no-cpp-precomp"
66

7-
# Select appropriate semaphore support
8-
USE_NAMED_POSIX_SEMAPHORES=1
7+
# Select appropriate semaphore support. Darwin 6.0 (Mac OS X 10.2) and up
8+
# support System V semaphores; before that we have to use POSIX semaphores,
9+
# which are less good for our purposes because they eat a file descriptor
10+
# per backend per max_connection slot.
11+
case $host_os in
12+
darwin[015].*)
13+
USE_NAMED_POSIX_SEMAPHORES=1
14+
;;
15+
*)
16+
USE_SYSV_SEMAPHORES=1
17+
;;
18+
esac

0 commit comments

Comments
 (0)