Orkcore threading

From tweakoz/orkid · View interactive version

Orkcore threading is an AI agent skill from the GitHub repository tweakoz/orkid. Answer questions about orkid's threading, concurrency, operation queues (OPQ), LockedResource, thread pools, futures, and task graphs. Use when the user asks about async, threading, mutexes, concurrent queues, or parallelism in orkid.

How to use this skill

Skill file

Orkid Core Threading & Concurrency Reference

When answering questions about threading or concurrency in orkid, consult the source files listed below. All paths are relative to the orkid repo root.

Key Files

| Component | Header | Implementation |

|-----------|--------|----------------|

| Operation Queue (OPQ) | ork.core/inc/ork/kernel/opq.h | ork.core/src/kernel/opq.cpp |

| Thread | ork.core/inc/ork/kernel/thread.h | ork.core/src/kernel/thread.cpp |

| Mutex / LockedResource | ork.core/inc/ork/kernel/mutex.h | (header-only) |

| Concurrent Queues | ork.core/inc/ork/kernel/concurrent_queue.h | (header-only templates) |

| Ring Buffer (MPMC) | ork.core/inc/ork/kernel/ringbuffer.hpp | (header-only template) |

| Thread Pool | ork.core/inc/ork/kernel/thread_pool.h | ork.core/src/kernel/thread_pool.cpp |

| Future | ork.core/inc/ork/kernel/future.hpp | ork.core/src/kernel/future.cpp |

| Task Graph | ork.core/inc/ork/kernel/taskgraph.h | ork.core/src/kernel/taskgraph.cpp |

| Semaphore | ork.core/inc/ork/kernel/semaphore.h | ork.core/src/kernel/semaphore.cpp |

| Atomic | ork.core/inc/ork/kernel/atomic.h | (header-only wrapper) |

Architecture Overview

Operation Queue (OPQ) - Primary Concurrency Mechanism

LockedResource<T> - Thread-Safe Data Wrapper

Concurrent Queues

Task Graph

Future

How to Answer

  1. For OPQ usage: read opq.h for the API, opq.cpp for thread management details
  2. For thread safety: check if code uses LockedResource or atomicOp patterns
  3. For queue selection: concurrentQueue() for CPU work, ioQueue() for I/O, serial queues for ordered work
  4. Always check actual header signatures — training data may be outdated
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.