Question

Does anyone know of a Java ExecutorService equivlent in VC++ 2008? What I want is a framework which I can pass tasks to fixed size thread pool. The framework should manage the thread pool itself (i.e. creation and destruction of threads).

Was it helpful?

Solution

Vista has a new thread pool API (in addition to existing, rather spartan thread pool API windows has had for a while): http://msdn.microsoft.com/en-us/library/ms686766%28VS.85%29.aspx . This API is not bound to any specific version of MSVC/VS but of course to use the new stuff you need to have Vista/Server 2008 or better. QueueUserWorkItem and RegisterWaitForSingleObject may be sufficient for your needs. As Nikola points out, 2010 will have the PPL. .NET also has some nice thread pool apis if you can code against C# or maybe C++/CLI instead of C++.

OTHER TIPS

I think Intel Threading Building Blocks supports something like this. Visual Studio 2010 will have Parallel Patterns Library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top