51 lock_guard<mutex> lock(ms_mutex);
52 if (!ms_reactors.empty())
57 signal(SIGPIPE, SIG_IGN);
58 assert(reactor_count > 0);
60 #if defined(__linux__)
76 ms_reactors.reserve(reactor_count+2);
77 for (uint16_t i=0; i<reactor_count+2; i++) {
78 reactor = make_shared<Reactor>();
79 ms_reactors.push_back(reactor);
81 ms_threads.create_thread(rrunner);
87 for (
size_t i=0; i<ms_reactors.size(); i++)
88 ms_reactors[i]->poll_loop_interrupt();
89 ms_threads.join_all();
95 ms_threads.join_all();
static bool verbose
Verbose mode.
PropertiesPtr properties
This singleton map stores all options.
static void initialize(uint16_t reactor_count)
Initializes I/O reactors.
Declarations for ReactorRunner.
static bool ms_epollet
Use "edge triggered" epoll.
static std::vector< ReactorPtr > ms_reactors
Vector of reactors (last position is timer reactor)
static std::default_random_engine rng
Pseudo random number generator.
Thread functor class for reacting to I/O events.
bool has(const String &name)
Check existence of a configuration value.
static std::atomic< int > ms_next_reactor
Atomic integer used for round-robin assignment of reactors.
static boost::thread_group ms_threads
Boost thread_group for managing reactor threads.
static HandlerMapPtr handler_map
Smart pointer to HandlerMap.
static void destroy()
This method shuts down the reactors.
static void join()
Joins with reactor threads.
static const OsInfo & os_info()
Retrieves updated Operating system information (see SystemInfo.h)
Compatibility Macros for C/C++.
std::shared_ptr< Reactor > ReactorPtr
Shared smart pointer to Reactor.
Declarations for HandlerMap.
static bool shutdown
Flag indicating that reactor thread is being shut down.
Declarations for ReactorFactory.
System information and statistics based on libsigar.
static std::mutex ms_mutex
Mutex to serialize calls to initialize.
void set_reactor(ReactorPtr &reactor)
Assocates reactor state object with this ReactorRunner.
static bool proxy_master
Set to true if this process is acting as "Proxy Master".