Back to directory

Locking

Agent skill
1 skill

Pick a PostgreSQL backend lock primitive (atomic / spinlock / LWLock / heavyweight / predicate / buffer-pin-content) or debug a lock-ordering bug, silent LWLock hang, deadlock-detector report, or a multixact / tuple-lock interaction — the six-layer PG lock taxonomy in operational form. Covers pgatomicu32 / u64 ordering + memory barriers, SpinLockAcquire / SpinLockRelease (with the "no calls / no ereport / no CHECKFORINTERRUPTS" rules), LWLockAcquire LWSHARED / LWEXCLUSIVE and tranches (lwlocklist.h + waiteventnames.txt), heavyweight LockAcquire / LockRelationOid / LOCKTAG, predicate (SSI) locks, buffer pin / content locks, the BufferMapping / LockManager / PredicateLockManager partition rank rules, multi-XID HEAPXMAXISMULTI interaction with FOR UPDATE / FOR KEY SHARE, parallel-worker lock-group semantics, and the lldb-attach recipe for silent-LWLock-deadlock diagnosis. Use this skill proactively whenever the user is writing or reviewing C in src/backend or dev/src/backend that touches shared memory (MainLWLockArray, PGPROC, ProcArray, BufferDesc, SLRU, any Shmem allocation), adds a new LWLock tranche (RequestNamedLWLockTranche / LWLockNewTrancheId / PGLWLOCK / PGLWLOCKTRANCHE), picks between spinlock / LWLock / atomic / heavyweight for new shmem state, asks about LWLock partition rank order, debugs an LWLock hang where pgstatactivity shows waiteventtype='LWLock' but no deadlock detected ever fires, hits an assertion like IsRelationExtensionLockHeld, gets bitten by HEAPXMAXISMULTI and GetMultiXactIdMembers, asks about parallel-worker lock-group conflicts, or reviews a patch that adds shmem state / new wait events — even when the user doesn't use the literal word "lock". Skip for pthreadmutext / std::mutex / Java synchronized / ReentrantLock / Go sync.Mutex / Rust std::sync::Mutex / parkinglot / tokio::sync::Mutex / C lock(obj) / Monitor.Enter, Redis pessimistic / Redlock / ZooKeeper / etcd / Chubby distributed locks, ORM optimistic locking (version int column), user-level / application-side SELECT FOR UPDATE design questions (how to model inventory claim), application-level lock-manager design (key→holder hash with TTLs), and general "what's the right lock primitive" non-PG advice.

Install with
Claude CodeCodexCursorGitHub CopilotGemini CLI

Supported by the Atlas install prompt. Skill-specific requirements vary.

Skill stats

Skills1CategoryEngineeringStars0

About this skill

Pick a PostgreSQL backend lock primitive (atomic / spinlock / LWLock / heavyweight / predicate / buffer-pin-content) or debug a lock-ordering bug, silent LWLock hang, deadlock-detector report, or a multixact / tuple-lock interaction — the six-layer PG lock taxonomy in operational form. Covers pgatomicu32 / u64 ordering + memory barriers, SpinLockAcquire / SpinLockRelease (with the "no calls / no ereport / no CHECKFORINTERRUPTS" rules), LWLockAcquire LWSHARED / LWEXCLUSIVE and tranches (lwlocklist.h + waiteventnames.txt), heavyweight LockAcquire / LockRelationOid / LOCKTAG, predicate (SSI) locks, buffer pin / content locks, the BufferMapping / LockManager / PredicateLockManager partition rank rules, multi-XID HEAPXMAXISMULTI interaction with FOR UPDATE / FOR KEY SHARE, parallel-worker lock-group semantics, and the lldb-attach recipe for silent-LWLock-deadlock diagnosis. Use this skill proactively whenever the user is writing or reviewing C in src/backend or dev/src/backend that touches shared memory (MainLWLockArray, PGPROC, ProcArray, BufferDesc, SLRU, any Shmem allocation), adds a new LWLock tranche (RequestNamedLWLockTranche / LWLockNewTrancheId / PGLWLOCK / PGLWLOCKTRANCHE), picks between spinlock / LWLock / atomic / heavyweight for new shmem state, asks about LWLock partition rank order, debugs an LWLock hang where pgstatactivity shows waiteventtype='LWLock' but no deadlock detected ever fires, hits an assertion like IsRelationExtensionLockHeld, gets bitten by HEAPXMAXISMULTI and GetMultiXactIdMembers, asks about parallel-worker lock-group conflicts, or reviews a patch that adds shmem state / new wait events — even when the user doesn't use the literal word "lock". Skip for pthreadmutext / std::mutex / Java synchronized / ReentrantLock / Go sync.Mutex / Rust std::sync::Mutex / parkinglot / tokio::sync::Mutex / C lock(obj) / Monitor.Enter, Redis pessimistic / Redlock / ZooKeeper / etcd / Chubby distributed locks, ORM optimistic locking (version int column), user-level / application-side SELECT FOR UPDATE design questions (how to model inventory claim), application-level lock-manager design (key→holder hash with TTLs), and general "what's the right lock primitive" non-PG advice.

Quick start

  1. Copy the install prompt. Use the green button above this README.
  2. Send it to your agent. Paste it into your coding agent’s chat and send.
  3. Review the setup. Your agent checks the skill’s instructions, requirements, and installation scope.
Review, license & listing details
Review the source before using this skill

This is an imported listing. We haven’t certified its safety, license, or compatibility. Skills may include executable scripts.

Automated security scan: Partial

Only SKILL.md was scanned. Supporting files and scripts were not checked. No safety grade has been assigned.

0 potential findings · Scanned 11/4/2026 · Scanner 0.2.1

Content SHA-256: b9961b00d348f1b2fc65784d5767e71725b82b0fa6237dcb51352cfc4d76efdf

About scan coverage and limitations

About this listing

Category
Engineering
Reported license
PostgreSQL
Listing language (estimated)
English
Review status
Not individually reviewed
Agent compatibility
Atlas installation supports Claude Code, Codex, and Cursor. Skill-specific dependencies and features are checked during setup.
Locking | Agent Skills Atlas