threadman 0.1.0
Header-only C++23 managed threads, dynamic pools, futures, and executors
Loading...
Searching...
No Matches
Classes | Namespaces
task.hpp File Reference

threadman::TaskHandle — a ref-counted, shareable handle to a single task's lifecycle (id, name, owning pool, current state, and timestamps). More...

#include <threadman/display.hpp>
#include <threadman/stats.hpp>
#include <commons/display_info.hpp>
#include <atomic>
#include <chrono>
#include <cstdint>
#include <exception>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <utility>
Include dependency graph for task.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  threadman::TaskHandle
 
struct  threadman::TaskHandle::State
 Heap-resident bookkeeping for a single task. More...
 

Namespaces

namespace  threadman
 

Detailed Description

threadman::TaskHandle — a ref-counted, shareable handle to a single task's lifecycle (id, name, owning pool, current state, and timestamps).

The pool produces one TaskHandle per submission, hands a copy to the caller (typically routed through a Future), and keeps a copy in its recent-tasks ring. The underlying State is heap-allocated and lives as long as any handle to it.

All transitions go through mark_* helpers under an internal mutex so a snapshot() taken concurrently always sees a consistent view.