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

my_dummy_slot.hint_for_push and hint_for_pop used uninitialized

vanswaaij
Beginner
209 Views

It seems that tbb::internal::generic_scheduler.my_dummy_slot.hint_for_push and hint_for_pop remain uninitialized before use in task_stream::push or pop.

This is in tbb40_233oss, compiled on LINUX FEDORA 14

Thanks.


0 Kudos
3 Replies
Anton_M_Intel
Employee
209 Views
Well, you are right that hints are not initialized for dummy slot. However, it is not a correctness issue. Because, 1) hints are used to distribute contention in the starvation-resistent queue, the actual value is not really important, and 2)slots in arena object are initilized by memset first and then by arena::process when a worker joins, the dummy slot can probably be used only by master thread in some situations - not a problem.
Are you rather concerned about some warning by the compiler or a correctness tool?
0 Kudos
vanswaaij
Beginner
209 Views
Well, you are right that hints are not initialized for dummy slot. However, it is not a correctness issue. Because, 1) hints are used to distribute contention in the starvation-resistent queue, the actual value is not really important, and 2)slots in arena object are initilized by memset first and then by arena::process when a worker joins, the dummy slot can probably be used only by master thread in some situations - not a problem.
Are you rather concerned about some warning by the compiler or a correctness tool?

I thought as much but wanted to be sure.
I'm evaluating Intel Inspector XE and both fields were flagged as being used uninitialized.

Thanks for looking.
0 Kudos
Alexey-Kukanov
Employee
209 Views
Thank you for reporting the issue.
Though it is not a real correctness issue as Anton mentioned, I think there is no good reason not to initialize these fields; in other words, we will fix it.
0 Kudos
Reply