Tasks Overview

Tasks are the fundamental data elements in the Intel® ITT API. A task is a logical unit of work on a specific thread. Tasks can nest; thus, tasks typically correspond to functions, scopes, or a case block in a switch statement.


 // Create domain and a couple of tasks names at global scope

 __itt_domain* domain = __itt_domain_create(L”MyTraces.MyDomain”);

 __itt_string_handle* shMyTask = __itt_string_handle_create(L”My Task”);

 __itt_string_handle* shMySubtask = __itt_string_handle_create(L”My SubTask”);


 void BeginFrame() {

     __itt_task_begin(domain, __itt_null, __itt_null, shMyTask);


 void DoWork() {

     __itt_task_begin(domain, __itt_null, __itt_null, shMySubtask);




 void EndFrame() {



 void Main() {






A task instance represents a piece of work performed by a particular thread for a period of time.
A call to __itt_task_begin() creates a task instance. This becomes the current task instance for that thread.
A call to __itt_task_end() on the same thread ends the current task instance.

It is possible to relate tasks to one another using IDs together with the Relations API functions.  


The task is defined by the bracketing of __itt_task_begin() and __itt_task_end() on the same thread. The ITT API does not support scheduling mechanisms that cause task switching (the thread suspends the current task and switches to a different task) or task stealing (the task moves to a different thread).

See Also


Tasks Overview