You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase II of the h5cpp multithreading workplan (tasks/h5cpp-fapl-multithreading-workplan.md §4) — first of two PRs.
This PR introduces the descriptor types, FAPL executor property, and executor thread that together give Phase II its lifecycle. Operation overloads (h5::write / h5::read / h5::create for ds/gr/attr on async fds) are out of scope here — they land in a follow-up issue once the scaffold is stable.
h5::is_async_v<T> trait + a concepts::file_descriptor<T> covering both classic and async are added so future operation overloads can dispatch via if constexpr.
Mechanism
Mirror of the Phase I (#250) shared-ptr-in-slot pattern, applied to an executor instead of a pool:
Unblocks: Phase II operation overloads (separate issue) and Phase II concurrent-write tests.
Design discussion (settled)
Namespace shape: h5::async::fd_t (nested namespace) over h5::async_fd_t (prefix).
Factory shape: named factories h5::async::create / open. No h5::async tag literal, no explicit template argument at call sites, no property-pack dispatch.
Operations stay in h5:: and dispatch via concept-constrained function templates + TAD on the FD type.
h5::pt_t becomes a class template template <class DS = h5::ds_t> deduced via CTAD — tracked in the follow-up issue.
h5::threads{N} | h5::backpressure{K} is orthogonal to h5::async: Phase I and Phase II are composable but distinct concerns.
Phase II of the h5cpp multithreading workplan (
tasks/h5cpp-fapl-multithreading-workplan.md§4) — first of two PRs.This PR introduces the descriptor types, FAPL executor property, and executor thread that together give Phase II its lifecycle. Operation overloads (
h5::write/h5::read/h5::createfor ds/gr/attr on async fds) are out of scope here — they land in a follow-up issue once the scaffold is stable.Surface
The
false, falsespecialization disablesoperator ::hid_t()so user code can't bypass the executor by calling HDF5 directly:h5::is_async_v<T>trait + aconcepts::file_descriptor<T>covering both classic and async are added so future operation overloads can dispatch viaif constexpr.Mechanism
Mirror of the Phase I (#250) shared-ptr-in-slot pattern, applied to an executor instead of a pool:
H5Pfapl_async.hpp— executor FAPL property;h5::async::create/h5::async::openinstall the slot.H5executor.hpp— single executor thread per async fd (std::jthreadon C++20,stoppable_thread_tshim on C++17). MPSC command queue (256 slots),submit_and_waitfacade.shared_ptr<worker_pool_t>resolved from the FAPL or auto-installed at default size).std::futurereturned by the command queue.Out of scope (follow-up issue)
h5::write,h5::read,h5::append,h5::flush).h5::create(async_fd, ...)).h5::pt_tCTAD class template — separate refactor; tracked alongside the operation overloads.--enable-threadsafe.Acceptance criteria
H5Gcreate2(async_fd, ...)and equivalents are compile-fail with a clear= deletediagnostich5::async::create / openround-trip — file opens, closes, executor joinssubmit_and_waitH5Pfapl_async.hppreuses the slot helper extracted from #250 (deduplicatecopy_cb/close_cbpattern across pool and executor)worker_pool_tauto-installed whenh5::async::create / openis called withouth5::threads{N}Coupling
worker_pool_t,H5Pinsert2pattern.Design discussion (settled)
h5::async::fd_t(nested namespace) overh5::async_fd_t(prefix).h5::async::create / open. Noh5::asynctag literal, no explicit template argument at call sites, no property-pack dispatch.h5::and dispatch via concept-constrained function templates + TAD on the FD type.h5::pt_tbecomes a class templatetemplate <class DS = h5::ds_t>deduced via CTAD — tracked in the follow-up issue.h5::threads{N} | h5::backpressure{K}is orthogonal toh5::async: Phase I and Phase II are composable but distinct concerns.