> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 방법: 스레드 풀 작업 큐 만들기

> 방법: 스레드 풀 작업 큐 만들기

## 예제

다음 예에서는 시스템 스레드 풀에서 작업 콜백과 완료 콜백을 모두 디스패치하는 작업 큐를 만드는 방법을 보여 줍니다.

```c++ theme={null}
void CreatingTaskQueue()  
{  
    XTaskQueueHandle queue;  
 
    HRESULT hr = XTaskQueueCreate(  
        XTaskQueueDispatchMode::ThreadPool,  
        XTaskQueueDispatchMode::ThreadPool,  
        &queue);  
 
    if (FAILED(hr))  
    { 
        printf("Creating queue failed: 0x%x\r\n", hr);  
        return;  
    }  
 
    SubmitCallbacks(queue); 
 
    // Wait a while for the callbacks to run.  
    Sleep(1000);  
 
    XTaskQueueTerminate(queue, true, nullptr, nullptr);  
}  
```

## 샘플 출력

```
Worker invoked on thread 11440. Cancel? 0. 
Completion invoked on thread 11440. Cancel? 0.  
```

## 참고 항목

[작업 큐 설계](/build/core-features/common/async/async-task-queue-design)


## Related topics

- [방법: 수동 작업 큐 만들기](/ko/build/core-features/common/async/async-task-queue-design-howto/creating-manual-task-queue.md)
- [방법: 복합 작업 큐 만들기](/ko/build/core-features/common/async/async-task-queue-design-howto/creating-composite-task-queue.md)
- [비동기 작업 큐 설계](/ko/build/core-features/common/async/async-task-queue-design.md)
- [XTaskQueueDispatchMode](/ko/reference/system/xtaskqueue/enums/xtaskqueuedispatchmode.md)
- [비동기 호출 만들기](/ko/services/playfab/sdks/c/async.md)
