mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Implement new 'lightweight lock manager' that's intermediate between
existing lock manager and spinlocks: it understands exclusive vs shared lock but has few other fancy features. Replace most uses of spinlocks with lightweight locks. All remaining uses of spinlocks have very short lock hold times (a few dozen instructions), so tweak spinlock backoff code to work efficiently given this assumption. All per my proposal on pghackers 26-Sep-01.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: sinval.h,v 1.21 2001/08/26 16:56:02 tgl Exp $
|
||||
* $Id: sinval.h,v 1.22 2001/09/29 04:02:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "storage/backendid.h"
|
||||
#include "storage/itemptr.h"
|
||||
#include "storage/spin.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -64,8 +63,6 @@ typedef union
|
||||
} SharedInvalidationMessage;
|
||||
|
||||
|
||||
extern SPINLOCK SInvalLock;
|
||||
|
||||
extern int SInvalShmemSize(int maxBackends);
|
||||
extern void CreateSharedInvalidationState(int maxBackends);
|
||||
extern void InitBackendSharedInvalidationState(void);
|
||||
@@ -78,7 +75,7 @@ extern bool DatabaseHasActiveBackends(Oid databaseId, bool ignoreMyself);
|
||||
extern bool TransactionIdIsInProgress(TransactionId xid);
|
||||
extern TransactionId GetOldestXmin(bool allDbs);
|
||||
extern int CountActiveBackends(void);
|
||||
/* Use "struct proc", not PROC, to avoid including proc.h here */
|
||||
extern struct proc *BackendIdGetProc(BackendId procId);
|
||||
/* Use "struct PROC", not PROC, to avoid including proc.h here */
|
||||
extern struct PROC *BackendIdGetProc(BackendId procId);
|
||||
|
||||
#endif /* SINVAL_H */
|
||||
|
||||
Reference in New Issue
Block a user