Chris Fairles | 10 May 21:52
Picon
Gravatar

[future] Integrating recent future lib into old-ish threadpool lib

There's a nice threadpool library (http://threadpool.sourceforge.net)
mentioned on a previous thread that I took a look at and noticed it
had a basic future impl. of its own. Given that there's a future
library under review, I swapped out the original future impl. in the
schedule function, plus added a lazy_schedule (from the examples @
http://braddock.com/~braddock/future/ ) for fun.

I replaced everything in future.hpp from the threadpool lib with:

/*
* Copyright (c) 2005-2007 Philipp Henkel
*
* Use, modification, and distribution are  subject to the
* Boost Software License, Version 1.0. (See accompanying  file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
* http://threadpool.sourceforge.net
*
* Chris Fairles, May 2008 - Modified to replace custom future
implementation with boost-reviewed version
*/
#pragma once
#include <boost/future/future.hpp>

namespace boost { namespace threadpool
{

template<class Pool, class F>
future<typename result_of< F() >::type>
schedule(Pool& pool, F const& task)
(Continue reading)


Gmane