Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.06 KB

File metadata and controls

37 lines (25 loc) · 1.06 KB

work stealing queue

Language: Python · Sphere: programming · Category: Performance

Signature: (task_id: int) → str

What it does

Work-Stealing Queue Implementation

A thread-safe work-stealing queue system where workers can steal tasks from other workers when their local queues are empty.

Guarantee

When it runs, work stealing queue guarantees w.steal() == 3; w.get_local_task() == 2 and w.get_local_task() is None; sum(per_worker) == 200 (proven by run).

Checkable constraints:

  • w.get_local_task() == 1
  • w.steal() == 3
  • w.get_local_task() == 2 and w.get_local_task() is None
  • w.steal() is None
  • time.time() < deadline
  • sum(per_worker) == 200
  • wsq.get_completed_count() == 200
  • stolen_share > 0

Verification evidence

  • Green-run: ✓ passes (re-run under the extractor's gate)
  • Constraint strength: recovery (truth-pinned)
  • Independent oracle: — none yet (green-run candidate; not an axiom under the frozen ruler)
  • Peer review: unreviewed

△ AURA Pattern Library — © Reality Optimizer