Community
cancel
Showing results for 
Search instead for 
Did you mean: 
christiecohen
Beginner
63 Views

What's the varible "steal_begin" and "steal_end" used for?

I read the code of task scheduler, found that the "steal_begin" and "steal_end" is widely used?

I'm wondering whatare theyused for?
I guess maybe to restrict the work stealing.

But I don't really know how.

Why initialize the steal_end to -3 and -4?

Another question is, what set the slot number to twice of the worker number?


Thanks.
Looking forward your reply.
0 Kudos
6 Replies
christiecohen
Beginner
63 Views

Quoting - christiecohen
I read the code of task scheduler, found that the "steal_begin" and "steal_end" is widely used?

I'm wondering whatare theyused for?
I guess maybe to restrict the work stealing.

But I don't really know how.

Why initialize the steal_end to -3 and -4?

Another question is, what set the slot number to twice of the worker number?


Thanks.
Looking forward your reply.

Has any Intel guy seen my problem?

Please give me some tips.
Alexey_K_Intel3
Employee
63 Views

These variables were used in the implementation of the task pool used up to TBB 2.1. Their main purpose was to restrict task stealing, as you correctly guessed. steal_end was also used to lock the task pool during spawning, taking out, or stealing a task.

For the next version of TBB, the task pool implementation and some related classes were redesigned to use more modern, scalable, and lower overhead algorithm. These two variables have gone in the new implementation, which is available in OSS development releases.
christiecohen
Beginner
63 Views

These variables were used in the implementation of the task pool used up to TBB 2.1. Their main purpose was to restrict task stealing, as you correctly guessed. steal_end was also used to lock the task pool during spawning, taking out, or stealing a task.

For the next version of TBB, the task pool implementation and some related classes were redesigned to use more modern, scalable, and lower overhead algorithm. These two variables have gone in the new implementation, which is available in OSS development releases.

And why the slot number was initialized to twice the number of workerThread?
christiecohen
Beginner
63 Views

Quoting - christiecohen

And why the slot number was initialized to twice the number of workerThread?

Besides, is the newer version of source code provided?

I only found the tbb20_014oss_src
robert_jay_gould
Beginner
63 Views

Quoting - christiecohen

Besides, is the newer version of source code provided?

I only found the tbb20_014oss_src

You need to check the Development Release downloads. Here is a link (that works circa 2008/05).



Alexey_K_Intel3
Employee
63 Views

Quoting - christiecohen
And why the slot number was initialized to twice the number of workerThread?

It's to allow several master threads, in case a user wants to run TBB from different threads in his application.
Reply