ebb
ebb

Reputation: 9377

How does the ThreadPool work?

Exactly how do the threadpool in TPL work? Several blogs says that it works like:

However, the book Concurrent Programming on Windows by Joe Duffy, says that it works like:

Who's right?

Upvotes: 0

Views: 1164

Answers (1)

Johannes Kommer
Johannes Kommer

Reputation: 6451

The blogs seem to be correct in this case;

it first looks at the head of its local queue, then in the global queue, and then in the local queues of other threads.

Source: MSDN, see "Work Stealing"

Upvotes: 2

Related Questions