Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
async.h
Go to the documentation of this file.
1
8
9/*
10Copyright (c) 2026 MrXie1109
11
12Permission is hereby granted, free of charge, to any person obtaining a copy
13of this software and associated documentation files (the "Software"), to deal
14in the Software without restriction, including without limitation the rights
15to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16copies of the Software, and to permit persons to whom the Software is
17furnished to do so, subject to the following conditions:
18
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21
22THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28SOFTWARE.
29*/
30
31#pragma once
32#include "./async/channel.h"
33#include "./async/event.h"
34#include "./async/group.h"
35#include "./async/pool.h"
36#include "./async/queue.h"
37#include "./async/sched.h"
38#include "./async/task.h"
39#include "./async/thread.h"
40
41namespace console {}
基于环形缓冲区的有锁线程安全通信通道。
提供线程同步的 Event 类,支持设置、清除、等待和超时等待等操作。
异步任务组,用于管理一组异步任务的执行,提供添加任务、等待完成及回调通知功能。
本库所有组件所在的顶层命名空间。
简单的线程池实现,模仿了 Python 的 concurrent.futures.ThreadPoolExecutor 接口。
基于自旋的高性能 FIFO 队列,支持多生产者/多消费者并发场景。
基于条件变量的简单调度器,用于延迟执行或周期性的后台任务。
异步任务框架,提供 Task 和 SharedTask 两类异步任务工具。
线程封装类,提供线程的启动、停止和等待功能。