Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions include/logit_cpp/logit/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@

/// \}

/// \name Task executor settings
/// Configuration options for the task executor implementation.
/// \{

/// \brief Default capacity for the task executor ring buffer when unlimited is requested.
#ifndef LOGIT_TASK_EXECUTOR_DEFAULT_RING_CAPACITY
#define LOGIT_TASK_EXECUTOR_DEFAULT_RING_CAPACITY 1024
#endif

/// \}


/// \}

Expand Down
4 changes: 3 additions & 1 deletion include/logit_cpp/logit/detail/TaskExecutor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/// \file TaskExecutor.hpp
/// \brief Defines the TaskExecutor class, which manages task execution in a separate thread.

#include "../config.hpp"

#include <functional>
#include <atomic>
#if defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_PTHREADS__)
Expand Down Expand Up @@ -346,7 +348,7 @@ namespace logit { namespace detail {
std::atomic<std::size_t> m_dropped_tasks; ///< Number of discarded tasks due to overflow.
std::atomic<std::size_t> m_active_tasks; ///< Number of tasks currently running.

const std::size_t m_default_ring_cap = 1024; ///< Default capacity when unlimited requested.
const std::size_t m_default_ring_cap = LOGIT_TASK_EXECUTOR_DEFAULT_RING_CAPACITY; ///< Default capacity when unlimited requested.
MpscRingAny<std::function<void()>> m_mpsc_queue; ///< Lock-free bounded MPSC ring.

#ifdef LOGIT_ENABLE_DROP_OLDEST_SLOWPATH
Expand Down
Loading