Logo: Concurrency Reasoning

Concurrency Reasoning

Communautéit
adamentwistle
concurrency-reasoning

Disziplin bei asynchronen, concurrenten a gestreamten Operatiounen — fënnef Froen (iwwerlappend Duerchleef, Check-then-act, Ännerungen iwwer en await ewech, Reiefolleg vun den Äntwerten, Ofbriechen), Ëmfang vu Schutzmoossnamen, Feeler bei Fan-out, idempotent Widderhuelungen, Iwwerpréiwung vum gemeinsame Status a Verstäerkung vu Race Conditions. Benotzt dëst fir asynchrone Fan-out (Promise.all, gather), Streams/SSE/WebSockets, Queue-Worker, Cron-Jobs, Webhooks, Caches, Spären, Widderhuelungen a Feeler, déi als „heiansdo“, „duplizéiert“, „duebel verrechent“ oder „nëmmen ënner Belaaschtung“ beschriwwe ginn.

Add to TypingMind

Iwwersiicht

Editeuradamentwistle
Repositoryfable-skills
Skill-Nummconcurrency-reasoning
Stären
98
Forks
11
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    adamentwistle huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Concurrency Reasoning an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/adamentwistle/fable-skills/tree/main/concurrency-reasoning
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/adamentwistle/fable-skills.git /tmp/fable-skills
mkdir -p .claude/skills
cp -r /tmp/fable-skills/concurrency-reasoning .claude/skills/concurrency-reasoning
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Concurrency Reasoning an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Concurrency Reasoning automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Concurrency Reasoning net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Concurrency Reasoning

Concurrency bugs don't announce themselves in review — the code reads fine sequentially. Weak reasoning reads top to bottom and calls it correct. Strong reasoning asks a fixed set of questions about every async surface, because the compiler won't.

Step 0 — Inventory the surfaces

Before writing or reviewing, list every await/callback/handler/worker in the diff and every piece of state it touches that outlives one invocation (module globals, singletons, caches, class fields, DB rows, files). The questions below are asked per item on that list, not once per file.

The core question set

  1. What if this runs twice, overlapping? Two clicks, two requests, a retry racing the original, cron overlapping its previous run, a webhook delivered twice. If the answer is corrupted state or a double effect, add a guard: idempotency key, unique constraint, mutex, request de-dupe, disable-on-click.
  2. What happens between the check and the act? Every if (exists) then update on shared state is a TOCTOU window. Close it with an atomic operation (upsert, compare-and-swap, unique constraint, transaction) — not a smaller window.
  3. Who else mutates this while I await? Every await is a yield point: module variables, caches, closure-captured objects can change under you. Re-read after the await if it matters; don't carry pre-await reads across the gap.
  4. What order do these land in? Two in-flight requests resolve in either order. If responses update the same state (search-as-you-type, autosave), guard with sequence numbers, latest-wins checks, or cancel the superseded one.
  5. What happens on cancellation/unmount/disconnect mid-flight? Handlers firing after teardown need abort signals, mounted flags, or subscription cleanup. Partial effects from an aborted multi-step operation need cleanup or resumability.

Guard scope must match concurrency scope

An in-process mutex or in-memory de-dupe set guards one process only. If the service runs as multiple instances, workers, or serverless invocations, the guard must live where the contention is: database unique constraint, row lock, atomic compare-and-swap in the shared store, or a distributed lock with a lease. Name which one in the report.

Fan-out

For Promise.all/gather-style fan-out, decide what happens when one of N fails (abort the rest, collect all outcomes, report partial success as partial) and bound the concurrency — unbounded fan-out over a list of unknown size is a self-DoS.

Retries and exactly-once

  • Retry only idempotent operations, or make them idempotent first (idempotency keys, natural unique constraints). A retried "create" without one is a duplicate.
  • Backoff + jitter + a cap. Immediate retry in a loop is a DoS on your own dependency.
  • Distinguish "the request failed" from "the response failed" — the operation may have succeeded server-side. Design reads-back or upserts accordingly.

Shared-state audit

For each state item in the Step 0 inventory: who writes it, from how many concurrent contexts, and what serializes those writes? "Nothing serializes them, but it's probably fine" is a bug report from the future. Put the answer in the report.

Debugging suspected races

  • Flaky test → don't rerun until green. Amplify: run 20–100× in a loop, add load, add sleep at suspected interleaving points to widen the window until it fails deterministically.
  • Bisect by interleaving, not by code: log timestamps + IDs at each async boundary and reconstruct the actual order of the failing run.
  • The fix must name the interleaving it prevents, and a test must force that interleaving (two calls with a barrier or injected delay) and fail before the fix. "Added a lock and it stopped failing" without knowing the race is a hidden deadlock waiting.

Deadlock/starvation reflexes

Consistent lock ordering; never hold a lock across an await/IO; timeouts on anything that waits on another party; bounded queues (an unbounded queue turns backpressure into an OOM).

Heefeg gestallte Froen

Wat mécht de KI-Skill Concurrency Reasoning?

Disziplin bei asynchronen, concurrenten a gestreamten Operatiounen — fënnef Froen (iwwerlappend Duerchleef, Check-then-act, Ännerungen iwwer en await ewech, Reiefolleg vun den Äntwerten, Ofbriechen), Ëmfang vu Schutzmoossnamen, Feeler bei Fan-out, idempotent Widderhuelungen, Iwwerpréiwung vum gemeinsame Status a Verstäerkung vu Race Conditions. Benotzt dëst fir asynchrone Fan-out (Promise.all, gather), Streams/SSE/WebSockets, Queue-Worker, Cron-Jobs, Webhooks, Caches, Spären, Widderhuelungen a Feeler, déi als „heiansdo“, „duplizéiert“, „duebel verrechent“ oder „nëmmen ënner Belaaschtung“ be...

Firwat Concurrency Reasoning op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Concurrency Reasoning besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Concurrency Reasoning an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/adamentwistle/fable-skills/tree/main/concurrency-reasoning an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Concurrency Reasoning benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Concurrency Reasoning benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Concurrency Reasoning domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Concurrency Reasoning gratis?

Jo. adamentwistle huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇