AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Concurrency And Parallelism

skill-alisinadevelo-md-files-concurrency-and-parallelism · by AlisinaDevelo

>-

No reviews yet
0 installs
8 views
0.0% view→install

Install

$ agentstack add skill-alisinadevelo-md-files-concurrency-and-parallelism

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-alisinadevelo-md-files-concurrency-and-parallelism)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Concurrency And Parallelism? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Concurrency & Parallelism

Concurrency is about dealing with many things at once (structure); parallelism is about doing many things at once (execution). Both share the hard part: shared mutable state. The defining trait of concurrency bugs is that they're intermittent and timing-dependent — which is why they slip through tests and surface under production load.

The core rule

Don't share mutable state. If you must, protect every access to it. Most concurrency bugs are an unsynchronized read or write of state two tasks touch. The cheapest fix is usually to not share: give each task its own data, communicate by passing messages/values, and confine mutable state to one owner.

Patterns that work

  • Immutability — data that never changes after creation is automatically safe to share.

Prefer it.

  • Confinement — one thread/task owns a piece of state; others ask it, never touch it

directly (the actor model, a single writer, a worker that owns a connection).

  • Message passing over shared memory — hand off values through a queue/channel instead

of locking a shared structure. Easier to reason about than a web of locks.

  • Bounded parallelism — a worker pool / semaphore with a fixed size. Unbounded

goroutines/threads/promises are a resource-exhaustion outage.

When you do use locks

  • Hold locks for the shortest span; never do I/O or call out to unknown code while holding

one.

  • Acquire multiple locks in a consistent global order — out-of-order acquisition is the

classic deadlock. Better: don't hold more than one.

  • Pick the right primitive: mutex for exclusive, read-write lock for read-heavy, atomic for

a single counter/flag. A lock around a single increment is overkill; a missing one is a bug.

Async-specific traps

  • Don't block the event loop with sync I/O or CPU-bound work — it stalls every other

task. Offload to a thread/process pool.

  • Await your futures. A fire-and-forget promise swallows errors and races shutdown.
  • Parallelize independent awaits (Promise.all/gather); don't serialize them by

accident with sequential awaits.

Idempotency and ordering

Anything that may run twice (retries, at-least-once delivery, a re-fired event) must be idempotent — design the operation so a duplicate is harmless (idempotency keys, upserts, dedup). Don't assume ordering across concurrent producers unless you enforce it.

Diagnosing a race

It reproduces under load/ordering, not deterministically. Find what state two tasks share and which access is unsynchronized; a thread/race sanitizer or targeted logging of the interleaving confirms it. Don't "fix" it by adding a sleep — that hides the race, it doesn't remove it (see root-cause-debugging). The fix is to remove the sharing or synchronize the access, then prove it with the sanitizer or a stress test.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.