Add sequential execution support for serial interface functions#3
Merged
Add sequential execution support for serial interface functions#3
Conversation
- Introduced a new dispatch mechanism for executing serial interface functions sequentially across threads, ensuring that calls are processed in the order they are made. - Added corresponding sequential variants for multiple serial functions, including `serialAbortRead`, `serialRead`, `serialWrite`, and others, to enhance thread safety and execution consistency. - Updated the `serial.h` header to include the new sequential interface headers. This update improves the robustness of the serial API by providing a clear and reliable way to handle function calls in a sequential manner.
- Updated the note in the `getVersionSequential` function documentation to specify that it guarantees execution in the exact order the calls were made across threads. This change enhances the clarity of the function's behavior in a multi-threaded context.
- Introduced a new Doxyfile for generating documentation for the cpp-core project, specifying project details and output settings. - Removed the outdated GitHub Actions workflow for building WASM binaries. - Added a new GitHub Actions workflow for generating and deploying Doxygen documentation to GitHub Pages, including steps for installation and documentation generation. These changes enhance project documentation and streamline the deployment process for generated docs.
d069d60 to
901b2f1
Compare
901b2f1 to
a4ec5c7
Compare
Mqxx
requested changes
Jul 11, 2025
Member
Mqxx
left a comment
There was a problem hiding this comment.
We need to check if some sequential functions make sense...
include/cpp_core/interface/sequential/serial_set_error_callback_sequential.h
Outdated
Show resolved
Hide resolved
include/cpp_core/interface/sequential/serial_set_read_callback_sequential.h
Outdated
Show resolved
Hide resolved
include/cpp_core/interface/sequential/serial_set_write_callback_sequential.h
Outdated
Show resolved
Hide resolved
- Renamed `mtx` to `mutex` and `cv` to `condition_variable` in the `DispatchState` struct for improved clarity and consistency. - Updated corresponding references in the worker function and call method to reflect the new naming conventions. These changes enhance code readability and maintainability in the sequential dispatch implementation.
- Introduced a new `setQueueMode` function to allow selection between global and per-handle queue modes for sequential execution. - Updated existing serial interface functions to utilize the new per-handle mode, ensuring that calls can be executed concurrently across different handles while maintaining order within the same handle. - Added a new header file for the `setQueueMode` function and updated the main sequential interface header to include it. These changes enhance the flexibility and performance of the serial API by enabling concurrent execution across multiple serial handles.
- Updated comments and documentation in `sequential_dispatch.h` to clarify the behavior and usage of the sequential dispatching mechanism. - Improved descriptions for functions such as `queueMode`, `setQueueMode`, and `call`, emphasizing thread safety and the distinction between global and per-handle queue modes. - Added detailed explanations of the steps involved in executing callables and managing worker threads, enhancing overall clarity for future developers. These changes improve the comprehensibility of the sequential dispatch API, aiding developers in understanding its functionality and usage.
- Renamed the static variables in `handleStates` and `handleStatesMutex` from `states` and `mutex` to `instance` for improved clarity and consistency. - This change enhances code readability and aligns with the naming conventions established in previous commits.
Mqxx
requested changes
Jul 14, 2025
Mqxx
requested changes
Jul 14, 2025
Co-authored-by: Mqx <62719703+Mqxx@users.noreply.github.com>
- Deleted several sequential interface headers, including `get_version_sequential.h`, `serial_get_ports_info_sequential.h`, `serial_open_sequential.h`, and others, to streamline the codebase and eliminate unused functionality. - Removed associated inline functions that provided sequential variants for various serial operations, enhancing code clarity and maintainability. - This cleanup aligns with recent changes to the sequential dispatch mechanism, focusing on a more efficient and cohesive API design.
- Introduced a new header file `squential.h` that aggregates all sequential interface headers for improved organization and accessibility. - This change streamlines the inclusion of sequential functionalities, enhancing code maintainability and clarity for developers working with the serial interface.
- Added return type descriptions for the `handleStates` and `handleStatesMutex` functions to clarify their purpose and usage. - Improved formatting of parameter descriptions in the `call` and `ensureWorkerRunning` functions for better readability. These updates aim to improve the comprehensibility of the sequential dispatch API documentation, aiding developers in understanding its functionality.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a new sequential dispatch mechanism and corresponding sequential variants for serial interface functions to ensure thread-safe, ordered execution, and updates documentation and CI workflows.
- Introduce
sequential_dispatch.hwith per-handle queues and worker threads - Add sequential interface headers for all serial functions and include the aggregator in
serial.h - Update Doxygen config and add a docs workflow; remove the previous WASM build workflow
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| include/cpp_core/serial.h | Included the new sequential aggregator header |
| include/cpp_core/interface/sequential/squential.h | New aggregator header for sequential interfaces (filename typo) |
| include/cpp_core/interface/sequential/*.h | Sequential variants for all serial API functions |
| include/cpp_core/detail/sequential_dispatch.h | Implementation of the sequential dispatch queue and worker |
| Doxyfile | Initial Doxygen config added |
| .github/workflows/doxygen.yml | Added Doxygen documentation build & deploy workflow |
| .github/workflows/build.yml | Removed old WASM build workflow |
Comments suppressed due to low confidence (3)
include/cpp_core/interface/sequential/squential.h:1
- The aggregator header filename
squential.his misspelled and does not match its purpose or the include inserial.h. Consider renaming it toall.h(orsequential.h) for clarity and consistency.
#pragma once
include/cpp_core/serial.h:8
- The included header "interface/sequential/all.h" doesn’t exist; the new aggregator file is named
squential.h. Either rename the file toall.hor update this include to match the actual filename.
#include "interface/sequential/all.h"
- Replaced the inclusion of the deprecated `all.h` header with the new `sequential.h` header in `serial.h` to streamline header management. - Introduced `sequential.h`, which aggregates all sequential interface headers, enhancing code maintainability and accessibility for developers working with the serial interface.
Mqxx
requested changes
Jul 15, 2025
- Introduced a new `serial_sequential.h` header that aggregates all sequential interface headers, improving organization and accessibility. - Removed the deprecated `sequential.h` header from `serial.h` to streamline header management. - Updated several sequential interface files to include the new `internal/sequential_dispatch.h` for better encapsulation of dispatch logic. These changes enhance the maintainability and clarity of the serial interface, aligning with recent refactoring efforts.
Mqxx
requested changes
Jul 16, 2025
Mqxx
reviewed
Jul 16, 2025
- Replaced instances of `sequential_dispatch.h` with `call.h` in multiple sequential interface headers to streamline the dispatch logic. - Updated function calls to utilize the new `cpp_core::internal::sequential::call` method, ensuring consistent handling of sequential execution across the interface. - Improved formatting in several function implementations for better readability. These changes enhance the maintainability and clarity of the serial interface, aligning with recent refactoring efforts.
…eaders - Replaced individual sequential header inclusions in `serial_sequential.h` with a single inclusion of `sequential.h` for improved organization. - Introduced a new `sequential.h` header that consolidates all sequential interface headers, enhancing maintainability and accessibility. These changes streamline the header management in the serial interface, aligning with ongoing refactoring efforts.
Mqxx
requested changes
Jul 17, 2025
Co-authored-by: Mqx <62719703+Mqxx@users.noreply.github.com>
… `cpp_core.h` - Deleted the `serial_sequential.h` header to streamline the codebase and eliminate unused functionality. - Updated `cpp_core.h` to include the new `sequential.h` header, enhancing organization and maintainability of the serial interface. These changes align with ongoing refactoring efforts to improve header management and code clarity.
Mqxx
approved these changes
Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
serialAbortRead,serialRead,serialWrite, and others, to enhance thread safety and execution consistency.serial.hheader to include the new sequential interface headers.This update improves the robustness of the serial API by providing a clear and reliable way to handle function calls in a sequential manner.