diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-02-21 01:41:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-02-21 01:41:55 +0000 |
commit | 9d197856dd5eda5cf85b15e564ae09ef8fef0e9e (patch) | |
tree | ac85492fb01823aeb836e54f5e5511366346f418 /src/backend/storage/ipc/ipc.c | |
parent | 75cccd0ad3184e3fa283f407c765520d3c774c86 (diff) | |
download | postgresql-9d197856dd5eda5cf85b15e564ae09ef8fef0e9e.tar.gz postgresql-9d197856dd5eda5cf85b15e564ae09ef8fef0e9e.zip |
Rearrange handling of MAXBACKENDS a little bit. The default setting
of MAXBACKENDS is now 1024, since all it's costing is about 32 bytes of memory
per array slot. configure's --with-maxbackends switch now controls DEF_MAXBACKENDS
which is simply the default value of the postmaster's -N switch. Thus,
the out-of-the-box configuration will still limit you to 64 backends,
but you can go up to 1024 backends simply by restarting the postmaster with
a different -N switch --- no rebuild required.
Diffstat (limited to 'src/backend/storage/ipc/ipc.c')
-rw-r--r-- | src/backend/storage/ipc/ipc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c index 511893657f5..62a38e14aae 100644 --- a/src/backend/storage/ipc/ipc.c +++ b/src/backend/storage/ipc/ipc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.35 1999/02/13 23:18:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.36 1999/02/21 01:41:44 tgl Exp $ * * NOTES * @@ -677,9 +677,10 @@ struct ipcdummy SLock *free; int unused; slock_t memlock; - SLock slocks[NSLOCKS]; + SLock slocks[MAX_SPINS + 1]; }; -static int SLockMemorySize = sizeof(struct ipcdummy); + +#define SLOCKMEMORYSIZE sizeof(struct ipcdummy) void CreateAndInitSLockMemory(IPCKey key) @@ -688,7 +689,7 @@ CreateAndInitSLockMemory(IPCKey key) SLock *slckP; SLockMemoryId = IpcMemoryCreate(key, - SLockMemorySize, + SLOCKMEMORYSIZE, 0700); AttachSLockMemory(key); *FreeSLockPP = NULL; @@ -713,7 +714,7 @@ AttachSLockMemory(IPCKey key) struct ipcdummy *slockM; if (SLockMemoryId == -1) - SLockMemoryId = IpcMemoryIdGet(key, SLockMemorySize); + SLockMemoryId = IpcMemoryIdGet(key, SLOCKMEMORYSIZE); if (SLockMemoryId == -1) elog(FATAL, "SLockMemory not in shared memory"); slockM = (struct ipcdummy *) IpcMemoryAttach(SLockMemoryId); |