parking-lot

Provide non-poisoning Mutex, RwLock, Condvar, Once, ReentrantMutex, and FairMutex for Rust.

28|6|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/johnlindquist/script-kit-next --skill parking-lot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: parking-lot
Source: https://github.com/johnlindquist/script-kit-next/tree/main/.opencode/skill/parking-lot
Command: npx skills add https://github.com/johnlindquist/script-kit-next --skill parking-lot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides high-performance, memory-efficient synchronization primitives for Rust applications, offering a robust alternative to the standard library's synchronization tools.

Core Features & Use Cases

  • Reduced Overhead: Significantly smaller memory footprint for locks (1 byte for Mutex/RwLock).
  • No Lock Poisoning: Simplifies error handling by preventing locks from becoming unusable after a panic.
  • Performance: Optimized for better performance, especially under high contention.
  • Advanced Features: Supports fair locking, optional deadlock detection, and reentrant locking.
  • Use Case: Integrate into performance-critical Rust applications or systems where minimizing memory usage and simplifying panic recovery in concurrent code is essential.

Quick Start

Use the parking-lot skill to create a non-poisoning Mutex for shared data.

Frequently Asked Questions about parking-lot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce memory overhead for Mutex and RwLock in Rust?

You can reduce memory overhead by replacing standard library locks with compact synchronization primitives that shrink Mutex and RwLock down to 1 byte. This significantly decreases memory footprints while maintaining robust concurrency control in Rust.

How do I handle Mutex lock poisoning after a panic in Rust?

To handle Mutex lock poisoning, use non-poisoning synchronization primitives that prevent locks from becoming unusable after a panic. This simplifies concurrent error handling by allowing threads to safely acquire locks even if a previous holder panicked.

What is the best way to optimize Rust concurrency performance under high contention?

To optimize concurrency performance under high contention, use specialized synchronization primitives designed for contended access. These offer improved performance compared to standard library locks during heavy concurrent workloads in Rust.

Does this Skill support fair locking and deadlock detection for Rust concurrency?

Yes, this Skill supports fair locking and optional deadlock detection for robust concurrent programming. These advanced features allow you to enforce lock acquisition order and proactively diagnose complex concurrency issues during development.

Can I use a ReentrantMutex to acquire locks multiple times in the same Rust thread?

Yes, you can use a ReentrantMutex to allow the same Rust thread to safely acquire a lock multiple times without deadlocking. This prevents self-deadlock issues in recursive functions or complex nested call paths within concurrent applications.

When should I not use standard library synchronization primitives in Rust?

You should avoid standard library synchronization primitives when you need a smaller memory footprint, no lock poisoning, or better performance under high contention. Alternative primitives provide fair locking and deadlock detection for advanced concurrent use cases.