Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2466 Discussions

Enhancement Request: Parallel for/do order when limited to a single thread

Alex_N_Intel
Employee
259 Views

I would like to request an enhancement of TBB loop patterns: if the Task Scheduler is limited to a single thread, the behavior of parallel for/do/other loops should be sequential and completely backward compatible to a single-thread execution.

Motivation: we are moving legacy single-threaded code to parallel execution, we need to keep backward compatibility. Users that do not choose to use the new parallel features should experience no behavior change.

As for now, I have to maintain 2 code streams: parallel and single-threaded. This complicates the development and the result code.

It seems that enabling backward compatibility for a single thread is not complicated and will not add performance overhead for TBB parallel loops.

Thanks!
Alex Nikonov
0 Kudos
1 Reply
RafSchietekat
Valued Contributor III
259 Views
Could you specify the observed differences and why they matter?
0 Kudos
Reply