anmelt

スレッドの同期呼び出し

を作ってみた。 #ifndef ANMELT_THREAD_INVOKE_H_INCLUDED #define ANMELT_THREAD_INVOKE_H_INCLUDED // Boost #include <boost/thread.hpp> #include <boost/optional.hpp> #include <boost/noncopyable.hpp> #include <boost/ref.hpp> #include <boost/utility/enable_if.hpp> #include <boost/utility/result_of.hpp> #include …</boost/utility/result_of.hpp></boost/utility/enable_if.hpp></boost/ref.hpp></boost/noncopyable.hpp></boost/optional.hpp></boost/thread.hpp>

スレッドプール

Worker Thread パターンでスレッドプールを作ってみた。 worker_thread.h #ifndef ANMELT_THREAD_WORKER_THREAD_H_INCLUDED #define ANMELT_THREAD_WORKER_THREAD_H_INCLUDED // Boost #include <boost/thread.hpp> #include <boost/shared_ptr.hpp> #include <boost/function.hpp> #include <boost/bind.hpp> #include </boost/bind.hpp></boost/function.hpp></boost/shared_ptr.hpp></boost/thread.hpp>

汎用的な Balking コンテナ

を作ってみた。 #ifndef ANMELT_THREAD_BALKING_CONTAINER_H_INCLUDED #define ANMELT_THREAD_BALKING_CONTAINER_H_INCLUDED // Boost #include <boost/thread.hpp> namespace anmelt{ namespace thread { template<class Container, class Adapter> class balking_container { private: Container container_; </class></boost/thread.hpp>…

汎用的な Blocking コンテナ

を作ってみた。 #ifndef ANMELT_THREAD_BLOCKING_CONTAINER_H_INCLUDED #define ANMELT_THREAD_BLOCKING_CONTAINER_H_INCLUDED // Boost #include <boost/thread.hpp> namespace anmelt{ namespace thread { template<class Container, class Adapter> class blocking_container { private: Container container</class></boost/thread.hpp>…

既存のオブジェクトをスレッドセーフにする

こんなの作ってみました。 #ifndef ANMELT_THREAD_MUTEXED_H_INCLUDED #define ANMELT_THREAD_MUTEXED_H_INCLUDED #include <boost/thread.hpp> #include <boost/utility/enable_if.hpp> #include <boost/utility/result_of.hpp> #include <boost/type_traits/is_void.hpp> namespace anmelt{ namespace thread { template</boost/type_traits/is_void.hpp></boost/utility/result_of.hpp></boost/utility/enable_if.hpp></boost/thread.hpp>