task @main() %t1 = spawn @compute_pi(0, 1000000) %t2 = spawn @compute_pi(1000000, 2000000) %res1 = await %t1 %res2 = await %t2 %total = fadd %res1, %res2

: The compiler needs to identify parts of the code that can be executed concurrently. This involves advanced analysis techniques, including data dependency analysis and control flow analysis.

Modern software applications, especially those in the domains of scientific computing, data analysis, and real-time systems, increasingly rely on concurrent execution of tasks to achieve high performance and responsiveness. Traditional compilers focus on optimizing the execution of sequential code, which may not be sufficient for applications that can benefit from or require parallel execution.

Too fine-grained: The scheduler's overhead dominates execution time. Too coarse-grained: One core sits idle while another struggles with a giant task.

tasking compiler
tasking compiler