Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/util/BatchExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
namespace stellar
{

const size_t WORKER_STACK_BYTES = 1 << 23; // 8 MiB

namespace
{
struct CpuPinning
Expand Down Expand Up @@ -160,7 +162,7 @@ BatchExecutor::ensureWorkers(size_t count)
{
size_t index = mWorkers.size();
uint64_t batchId = mBatchId;
mWorkers.emplace_back(
mWorkers.emplace_back(WORKER_STACK_BYTES,
[this, index, batchId]() { workerLoop(index, batchId); });
Comment thread
graydon marked this conversation as resolved.
Outdated
pinWorker(index);
}
Expand Down
4 changes: 2 additions & 2 deletions src/util/BatchExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "lib/util/finally.h"
#include "util/GlobalChecks.h"
#include "util/NonCopyable.h"
#include "util/StackThread.h"

#include <atomic>
#include <condition_variable>
Expand All @@ -15,7 +16,6 @@
#include <exception>
#include <functional>
#include <mutex>
#include <thread>
#include <type_traits>
#include <vector>

Expand Down Expand Up @@ -77,7 +77,7 @@ class BatchExecutor : private NonMovableOrCopyable
// with std::condition_variable.
std::mutex mMutex;
std::condition_variable mCondition;
std::vector<std::thread> mWorkers;
std::vector<StackThread> mWorkers;
// All allowed logical CPUs in pinning-preference order.
std::vector<unsigned> mPinCpuOrder;
// Number of distinct physical cores found in the allowed logical CPUs.
Expand Down
Loading
Loading