Files
XCEngine/docs/api/threading/threading-tasksystemconfig.md

34 lines
892 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TaskSystemConfig
**命名空间**: `XCEngine::Threading`
**类型**: `struct`
**描述**: 任务系统配置结构体。
## 结构体成员
| 成员 | 类型 | 描述 | 默认值 |
|------|------|------|--------|
| `workerThreadCount` | `uint32_t` | 工作线程数量0=自动检测) | 0 |
| `enableTaskProfiling` | `bool` | 启用任务性能分析 | true |
| `stealTasks` | `bool` | 启用工作窃取 | true |
| `maxTaskQueueSize` | `uint32_t` | 最大任务队列大小 | 1024 |
| `threadStackSize` | `uint32_t` | 线程栈大小0=默认) | 0 |
## 使用示例
```cpp
TaskSystemConfig config;
config.workerThreadCount = std::thread::hardware_concurrency();
config.enableTaskProfiling = true;
config.stealTasks = true;
config.maxTaskQueueSize = 2048;
TaskSystem::Get().Initialize(config);
```
## 相关文档
- [TaskSystem](./threading-task-system.md) - 任务系统