34 lines
892 B
Markdown
34 lines
892 B
Markdown
# 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) - 任务系统
|