Change max batch to one
This commit is contained in:
@@ -103,10 +103,12 @@ struct HttpHandler : ConnectionHandler {
|
||||
});
|
||||
stage0Thread = std::thread{[this]() {
|
||||
pthread_setname_np(pthread_self(), "stage-0");
|
||||
int nulls = 0;
|
||||
for (;;) {
|
||||
auto guard = pipeline.acquire<0, 0>();
|
||||
auto guard = pipeline.acquire<0, 0>(1);
|
||||
for (auto &c : guard.batch) {
|
||||
if (!c) {
|
||||
nulls += !c;
|
||||
if (nulls == 2) {
|
||||
return;
|
||||
}
|
||||
for (volatile int i = 0; i < loopIterations; i = i + 1)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
constexpr int loopIterations = 1550;
|
||||
constexpr int loopIterations = 1725;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
#include <immintrin.h>
|
||||
#endif
|
||||
|
||||
// Wait strategies for controlling thread blocking behavior when no work is
|
||||
// available
|
||||
enum class WaitStrategy {
|
||||
@@ -151,6 +155,9 @@ uint32_t calculate_safe_len(
|
||||
if (push != thread.local_pops) {
|
||||
goto dont_wait;
|
||||
}
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
_mm_pause();
|
||||
#endif
|
||||
}
|
||||
pushes.wait(push, std::memory_order_relaxed);
|
||||
dont_wait:;
|
||||
|
||||
Reference in New Issue
Block a user