mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
Split the shared-memory array of PGPROC pointers out of the sinval
communication structure, and make it its own module with its own lock. This should reduce contention at least a little, and it definitely makes the code seem cleaner. Per my recent proposal.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.58 2004/12/31 22:00:56 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.59 2005/05/19 21:35:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -17,10 +17,12 @@
|
||||
#include "miscadmin.h"
|
||||
#include "storage/backendid.h"
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/pmsignal.h"
|
||||
#include "storage/proc.h"
|
||||
#include "storage/shmem.h"
|
||||
#include "storage/sinvaladt.h"
|
||||
|
||||
|
||||
SISeg *shmInvalBuffer;
|
||||
|
||||
static void CleanupInvalidationState(int status, Datum arg);
|
||||
@@ -72,7 +74,6 @@ SIBufferInit(int maxBackends)
|
||||
{
|
||||
segP->procState[i].nextMsgNum = -1; /* inactive */
|
||||
segP->procState[i].resetState = false;
|
||||
segP->procState[i].procStruct = INVALID_OFFSET;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +134,6 @@ SIBackendInit(SISeg *segP)
|
||||
/* mark myself active, with all extant messages already read */
|
||||
stateP->nextMsgNum = segP->maxMsgNum;
|
||||
stateP->resetState = false;
|
||||
stateP->procStruct = MAKE_OFFSET(MyProc);
|
||||
|
||||
/* register exit routine to mark my entry inactive at exit */
|
||||
on_shmem_exit(CleanupInvalidationState, PointerGetDatum(segP));
|
||||
@@ -163,7 +163,6 @@ CleanupInvalidationState(int status, Datum arg)
|
||||
/* Mark myself inactive */
|
||||
segP->procState[MyBackendId - 1].nextMsgNum = -1;
|
||||
segP->procState[MyBackendId - 1].resetState = false;
|
||||
segP->procState[MyBackendId - 1].procStruct = INVALID_OFFSET;
|
||||
|
||||
/* Recompute index of last active backend */
|
||||
for (i = segP->lastBackend; i > 0; i--)
|
||||
|
||||
Reference in New Issue
Block a user