On non-tiny nodes, use an extra I/O thread.

This commit is contained in:
JoelKatz
2013-04-07 23:44:36 -07:00
parent 5928b3dcbf
commit 7e429dd14c

View File

@@ -46,7 +46,7 @@ DatabaseCon::~DatabaseCon()
} }
Application::Application() : Application::Application() :
// mIOService(2), mIOService((theConfig.NODE_SIZE >= 2) ? 2 : 1),
mIOWork(mIOService), mAuxWork(mAuxService), mUNL(mIOService), mNetOps(mIOService, &mLedgerMaster), mIOWork(mIOService), mAuxWork(mAuxService), mUNL(mIOService), mNetOps(mIOService, &mLedgerMaster),
mTempNodeCache("NodeCache", 16384, 90), mHashedObjectStore(16384, 300), mSLECache("LedgerEntryCache", 4096, 120), mTempNodeCache("NodeCache", 16384, 90), mHashedObjectStore(16384, 300), mSLECache("LedgerEntryCache", 4096, 120),
mSNTPClient(mAuxService), mJobQueue(mIOService), mFeeTrack(), mSNTPClient(mAuxService), mJobQueue(mIOService), mFeeTrack(),
@@ -100,6 +100,12 @@ static void runAux(boost::asio::io_service& svc)
svc.run(); svc.run();
} }
static void runIO(boost::asio::io_service& io)
{
NameThread("io");
io.run();
}
void Application::setup() void Application::setup()
{ {
mJobQueue.setThreadCount(); mJobQueue.setThreadCount();
@@ -307,6 +313,11 @@ void Application::setup()
void Application::run() void Application::run()
{ {
if (theConfig.NODE_SIZE >= 2)
{
boost::thread(boost::bind(runIO, boost::ref(mIOService))).detach();
}
mIOService.run(); // This blocks mIOService.run(); // This blocks
if (mWSPublicDoor) if (mWSPublicDoor)