Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
thread_pool_adapter.h File Reference

Adapter layer for thread_system integration. More...

#include <thread>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <queue>
#include <functional>
#include <memory>
#include <variant>
#include <string>
Include dependency graph for thread_pool_adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  database::async::fallback_context
 Fallback thread context (empty implementation) Provides a no-op context when thread_system is not available. More...
 
class  database::async::result_type< T >
 Fallback Result<T> implementation. More...
 
class  database::async::result_void_type
 Fallback result_void. More...
 

Namespaces

namespace  database
 
namespace  database::async
 

Typedefs

using database::async::thread_pool_type = fallback_thread_pool
 Fallback thread pool using std::thread Provides basic functionality when thread_system is not available.
 
template<typename JobType >
using database::async::typed_thread_pool_type = fallback_thread_pool
 Fallback typed thread pool (delegates to regular pool)
 
using database::async::job_type = fallback_job
 Fallback job type.
 
template<typename JobType >
using database::async::typed_job_type = fallback_job
 Fallback typed job.
 
using database::async::thread_context_type = fallback_context
 Fallback thread context (empty)
 
using database::async::monitoring_interface_type = void
 Fallback monitoring interface (no-op)
 
using database::async::logger_interface_type = void
 Fallback logger interface (no-op)
 

Variables

constexpr bool database::async::using_thread_system = false
 Compile-time flag indicating fallback mode.
 

Detailed Description

Adapter layer for thread_system integration.

This file provides conditional compilation support for thread_system. When USE_THREAD_SYSTEM is defined, it uses high-performance thread_system. Otherwise, it falls back to standard library threading.

Design Pattern: Adapter Pattern

  • Provides unified interface regardless of underlying implementation
  • Allows gradual migration from std::thread to thread_system
  • Zero runtime overhead when using compile-time selection

Usage

// Use unified types
Fallback thread context (empty implementation) Provides a no-op context when thread_system is not ava...
fallback_thread_pool thread_pool_type
Fallback thread pool using std::thread Provides basic functionality when thread_system is not availab...
Adapter layer for thread_system integration.

Definition in file thread_pool_adapter.h.