Removed comments
bench: 1181803
This commit is contained in:
1 parent
b2eb9ca81a
commit
0f410353d1
1 file changed
+5
-19
+5
-19
@@ -22,11 +22,11 @@
|
|||||||
// OS-dependent threading includes
|
// OS-dependent threading includes
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <io.h> // for _commit (if you ever use it)
|
#include <io.h>
|
||||||
#include <process.h> // _beginthreadex / _endthreadex
|
#include <process.h>
|
||||||
#else
|
#else
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <unistd.h> // for sync
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static std::filesystem::path MakeTempPath(const std::string& prefix, const std::string& ext) {
|
static std::filesystem::path MakeTempPath(const std::string& prefix, const std::string& ext) {
|
||||||
@@ -84,9 +84,6 @@ static void ShowCursor() { std::cout << "\033[?25h"; }
|
|||||||
|
|
||||||
namespace DATAGEN {
|
namespace DATAGEN {
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// HTTP CLIENT FUNCTIONS (using system curl commands)
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
static bool PostJSON(const std::string& url, const std::string& jsonBody, std::string& response) {
|
static bool PostJSON(const std::string& url, const std::string& jsonBody, std::string& response) {
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
@@ -199,9 +196,6 @@ static std::string ExtractJSONValue(const std::string& json, const std::string&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// HEARTBEAT THREAD
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
static void HeartbeatThread(const std::string& username, int threads,
|
static void HeartbeatThread(const std::string& username, int threads,
|
||||||
std::atomic<bool>& stopFlag, const std::string& serverUrl) {
|
std::atomic<bool>& stopFlag, const std::string& serverUrl) {
|
||||||
@@ -218,10 +212,6 @@ static void HeartbeatThread(const std::string& username, int threads,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// EXISTING DATAGEN FUNCTIONS
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
// Signal handling globals
|
// Signal handling globals
|
||||||
static std::atomic<bool> g_shutdownRequested(false);
|
static std::atomic<bool> g_shutdownRequested(false);
|
||||||
|
|
||||||
@@ -553,10 +543,6 @@ static void* ThreadFunc(void* arg) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// MAIN RUN FUNCTIONS
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
void Run(int targetPositions, int threads) {
|
void Run(int targetPositions, int threads) {
|
||||||
SetupSignalHandlers();
|
SetupSignalHandlers();
|
||||||
|
|
||||||
@@ -575,7 +561,7 @@ void Run(int targetPositions, int threads) {
|
|||||||
std::vector<HANDLE> workerThreads;
|
std::vector<HANDLE> workerThreads;
|
||||||
workerThreads.reserve((threads > 1) ? (threads - 1) : 0);
|
workerThreads.reserve((threads > 1) ? (threads - 1) : 0);
|
||||||
|
|
||||||
const size_t stackSizeBytes = 8ull * 1024ull * 1024ull; // change to 16/32 MiB if needed
|
const size_t stackSizeBytes = 8ull * 1024ull * 1024ull;
|
||||||
|
|
||||||
for (int i = 0; i < threads - 1; ++i) {
|
for (int i = 0; i < threads - 1; ++i) {
|
||||||
CreateWorkerThread(i, positions, stopFlag, workerThreads, stackSizeBytes);
|
CreateWorkerThread(i, positions, stopFlag, workerThreads, stackSizeBytes);
|
||||||
@@ -697,7 +683,7 @@ void RunOnline(const std::string& username, int targetPositions, int threads) {
|
|||||||
std::vector<HANDLE> workerThreads;
|
std::vector<HANDLE> workerThreads;
|
||||||
workerThreads.reserve((threads > 1) ? (threads - 1) : 0);
|
workerThreads.reserve((threads > 1) ? (threads - 1) : 0);
|
||||||
|
|
||||||
const size_t stackSizeBytes = 8ull * 1024ull * 1024ull; // change to 16/32 MiB if needed
|
const size_t stackSizeBytes = 8ull * 1024ull * 1024ull;
|
||||||
|
|
||||||
for (int i = 0; i < threads - 1; ++i) {
|
for (int i = 0; i < threads - 1; ++i) {
|
||||||
CreateWorkerThread(i, positions, stopFlag, workerThreads, stackSizeBytes);
|
CreateWorkerThread(i, positions, stopFlag, workerThreads, stackSizeBytes);
|
||||||
|
|||||||
Reference in new issue
Block a user