Skip to content

feat: Integrate adaptive queue system and refactor naming conventions#3

Closed
kcenon wants to merge 4 commits into
mainfrom
adaptive-queue-integration
Closed

feat: Integrate adaptive queue system and refactor naming conventions#3
kcenon wants to merge 4 commits into
mainfrom
adaptive-queue-integration

Conversation

@kcenon

@kcenon kcenon commented Jun 16, 2025

Copy link
Copy Markdown
Owner

Summary

  • Integrate adaptive_job_queue into logger system for enhanced performance under high contention
  • Replace all abbreviated naming with full naming convention for better code readability
  • Update performance documentation with adaptive queue benchmark results

Test plan

  • Verify adaptive queue integration in logger system
  • Confirm naming convention consistency across codebase
  • Validate performance improvements in benchmarks
  • Test cross-platform compatibility
  • Ensure all unit tests pass

kcenon added 4 commits June 16, 2025 10:46
…rformance

- Add adaptive_job_queue support to log_collector with ADAPTIVE strategy
- Update console_writer to use adaptive queue with automatic optimization
- Update file_writer to use adaptive queue with automatic optimization
- Remove circular dependency in adaptive_job_queue.cpp
- Enable automatic queue strategy selection based on contention levels

Performance improvements:
- 2-5x throughput improvement under high contention scenarios
- Automatic switching between mutex-based and lock-free queues
- Reduced latency for logging operations
- Update README.md with detailed mutex vs lock-free performance comparison
- Add comprehensive logger performance enhancement section in performance.md
- Include detailed before/after performance tables and analysis
- Add performance test sample demonstrating adaptive queue capabilities
- Update benchmark tools to measure adaptive queue performance

Key performance improvements documented:
- 2-5x throughput improvement under contention
- Automatic strategy selection based on workload
- Detailed latency and throughput measurements
- Cross-platform performance validation
- Replace sync/ paths with synchronization/ (14 files)
- Replace config.h files with configuration.h (11 files)
- Rename remaining config.h files to configuration.h
- Organize synchronization directory structure
- Update all include path references
- Verify build system passes all tests
… adaptive queue integration

Major Changes:
- Integrated adaptive queue system across thread pool implementations
- Fixed multi-platform build compatibility issues
- Resolved logger module enum inconsistencies

Platform Compatibility:
- Fixed string encoding consistency across Windows/Linux/macOS
- Replaced platform-specific integer types (long/long long) with portable int64_t/uint64_t
- Improved MinGW filesystem library detection and linking
- Unified threading configuration using standard CMake find_package(Threads)
- Enhanced POSIX compliance by using _POSIX_C_SOURCE instead of _GNU_SOURCE

Code Quality Improvements:
- Fixed log_types enum value mismatches in formatter_extensions.h
- Corrected include paths in logger module files
- Added proper file endings (newlines) to all modified files
- Removed unused synchronization headers (cancellation_token.h, error_handling.h, sync_primitives.h)

Build System Enhancements:
- Added comprehensive multi-platform build analysis documentation
- Improved CMake compiler checks for better cross-platform support
- Enhanced vcpkg integration for dependency management

Testing:
- Updated unit tests to use new portable integer conversion functions
- Fixed test cases for argument parser with proper test data

This commit consolidates all work done to ensure the thread system builds successfully across all supported platforms (Windows MSVC/MinGW/MSYS2, Linux GCC/Clang, macOS AppleClang) while maintaining the new adaptive queue functionality.
@kcenon kcenon force-pushed the adaptive-queue-integration branch from 2ae7da7 to 6f02c56 Compare June 16, 2025 09:21
@kcenon kcenon closed this Jun 16, 2025
@kcenon kcenon deleted the adaptive-queue-integration branch June 16, 2025 09:22
@kcenon kcenon restored the adaptive-queue-integration branch June 16, 2025 11:24
@kcenon kcenon deleted the adaptive-queue-integration branch June 22, 2025 17:03
kcenon added a commit that referenced this pull request Oct 22, 2025
Problem Analysis:
Compilation fails with: "fatal error: kcenon/thread/utils/formatter.h: No such file or directory"

Files include formatter.h via: #include <kcenon/thread/utils/formatter.h>
This path exists at: thread_system/include/kcenon/thread/utils/formatter.h

But utilities CMakeLists.txt only added the path using generator expression
which may not evaluate correctly in all build scenarios.

Root Cause:
The previous code used:
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>

While technically correct, the relative path "../include" in a generator
expression may not resolve properly when the utilities target is used as
a FetchContent dependency.

Solution:
1. Use get_filename_component() to resolve the absolute path before
   adding it to target_include_directories()
2. Split include directories into separate calls for clarity
3. Apply fix to both STATIC library case and INTERFACE library case

Changes in utilities/CMakeLists.txt:
- Line 26: Added get_filename_component to resolve absolute path
- Lines 27-30: Added second target_include_directories with resolved path
- Lines 64-68: Same fix for INTERFACE library case

This ensures the root include directory is always correctly added to
the utilities target's include paths, regardless of build context.

Expected Result:
- utilities target correctly includes thread_system/include
- convert_string.cpp can find <kcenon/thread/utils/formatter.h>
- All CI builds compile successfully

Bonus: $10 (Issue #3 - Missing include path)
kcenon added a commit that referenced this pull request Apr 13, 2026
Problem Analysis:
Compilation fails with: "fatal error: kcenon/thread/utils/formatter.h: No such file or directory"

Files include formatter.h via: #include <kcenon/thread/utils/formatter.h>
This path exists at: thread_system/include/kcenon/thread/utils/formatter.h

But utilities CMakeLists.txt only added the path using generator expression
which may not evaluate correctly in all build scenarios.

Root Cause:
The previous code used:
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>

While technically correct, the relative path "../include" in a generator
expression may not resolve properly when the utilities target is used as
a FetchContent dependency.

Solution:
1. Use get_filename_component() to resolve the absolute path before
   adding it to target_include_directories()
2. Split include directories into separate calls for clarity
3. Apply fix to both STATIC library case and INTERFACE library case

Changes in utilities/CMakeLists.txt:
- Line 26: Added get_filename_component to resolve absolute path
- Lines 27-30: Added second target_include_directories with resolved path
- Lines 64-68: Same fix for INTERFACE library case

This ensures the root include directory is always correctly added to
the utilities target's include paths, regardless of build context.

Expected Result:
- utilities target correctly includes thread_system/include
- convert_string.cpp can find <kcenon/thread/utils/formatter.h>
- All CI builds compile successfully

Bonus: $10 (Issue #3 - Missing include path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant