oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

onetbb task Scheduler Bypass

Open sejabs opened this issue 4 months ago • 2 comments

Dear OneTbb developers: In the section "Migrating from low-level task API" of oneAPI Threading Building Blocks Developer Guide and API Reference, I just followed the code to implement a simplest Scheduler Bypass.

int main() {

tbb::task_group tg;

tg.run_and_wait([&tg] {
    std::println("spawned task.");

    return tg.defer([]{std::println("other task.");});
});

tg.wait();

return 0;}

However, there is no "other task." string printed on the screen. The used onetbb is 2021.13 and built with msvc 17.11. I also noticed the last sentence in section "Task Scheduler Bypass" which said "the only way to use this optimization is to use preview feature of ``onepai::tbb::task_group`". I tried set the TBB_PREVIEW_TASK_GROUP_EXTENSIONS macro to 1 but it didn't work.

sejabs avatar Oct 03 '24 14:10 sejabs