concurrency-primitives
/concurrency-primitives
Uczy poprawnego użycia blokad, atomików, kanałów i barier oraz tego, przed jaką klasą błędów chroni każdy z nich, przy kodzie współdzielącym stan między wątkami.
- Autor
- Amey-Thakur ↗
- Repozytorium
- AI-SKILLS ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.09.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Uczy poprawnego użycia blokad, atomików, kanałów i barier oraz tego, przed jaką klasą błędów chroni każdy z nich, przy kodzie współdzielącym stan między wątkami.
Oryginalny opis (EN)
Use locks, atomics, channels, and barriers correctly, and know which class of bug each prevents. Use when writing code that shares state between threads.
Jak działa
- Method
- Boundaries
Podgląd SKILL.md
--- name: concurrency-primitives description: Use locks, atomics, channels, and barriers correctly, and know which class of bug each prevents. Use when writing code that shares state between threads. --- # Concurrency primitives Shared mutable state without synchronisation produces bugs that appear under load, vanish under a debugger, and cannot be reproduced. The primitives are few and the discipline of using them consistently is the whole difficulty. ## Method 1. **Prefer not sharing.** Immutable data, message passing, and per-thread state eliminate whole classes of bug rather than managing them (see process-and-threads). 2. **Protect invariants, not variables.** A lock guards a set of state that must stay consistent together; locking each field separately protects nothing meaningful. 3. **Establish a lock ordering and keep it.** Deadlock comes from two threads acquiring the same locks in different orders, and a global ordering rule prevents it entirely. 4. **Hold locks briefly and never across input or output.** A lock held during a network call serialises the whole system on that call's latency. 5. **Use atomics for single values only.** They are cheap and correct for counters and flags, and they do not compose into multi-variable invariants. 6. **Prefer channels and queues for handoff.** Transferring ownership is easier to reason about than shared access, and it makes the concurrency visible in the design. 7. **Test concurrency deliberately.** Race detectors, stress under contention, and deterministic interleaving tests, because normal tests pass on broken concurrent code (see concurrency-testing). ## Boundaries Correct primitives do not guarantee correct design; a race-free program can still have a logical race in its business rules. Lock-free programming is subtle enough that library implementations should be preferred. Memory models differ between languages and hardware in ways that matter for low-level code.
Wersje
W bazie nie ma innych skilli o nazwie concurrency-primitives.
Migawka bazy z 13.11.2026 · wersja paczki ac1bf0745269 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 3 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100concurrency-safety
Podaje wzorce bezpieczeństwa współbieżności dla R3BL: Chain of Custody, Loud Lock Releases i Ergonomic Atomics, przy pracy z wątkami, blokadami i atomikami. - 90concurrency-testing
Wymusza przeploty wątków ujawniające wyścigi za pomocą barier, pętli obciążeniowych i testów linearyzowalności, przy testowaniu blokad, współdzielonego stanu i kodu lock-free. - 100kernel-concurrency
Pomaga wybierać między spinlockami a mutexami w jądrze Linuksa, używać RCU, seqlocków, completions i barier pamięci oraz debugować błędy scheduling-while-atomic. - 95go-concurrency
Pomaga pisać współbieżny kod w Go z użyciem goroutines, kanałów i wzorców pakietu sync. - 100go-concurrency-patterns
Uczy współbieżności w Go: goroutines, kanały, prymitywy sync i context, przy budowie aplikacji, worker pools i diagnozowaniu wyścigów danych. - 100go-concurrency-patterns
Uczy współbieżności w Go: goroutines, kanały, prymitywy sync i context, przy budowie aplikacji, worker pools i diagnozowaniu wyścigów danych.