Skip to content

Commit 21c3fbb

Browse files
committed
docs(architecture): require shared ownership for combined interfaces
Require backend and formatter pointers to share a control block when both refer to one complete object. Define the C++11 owner_before check and add the corresponding regression requirement while preserving support for distinct objects with one shared owner.
1 parent 176863e commit 21c3fbb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎docs/adr/0010-atomic-configuration-registration.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ when interface subobject addresses differ. One complete object must not appear
108108
in different strategies, including across backend/formatter roles. Distinct
109109
objects sharing one control block are not aliases merely for that reason.
110110
Within one strategy, a combined backend/formatter object still has only one
111-
execution mutex and must satisfy both interface contracts. No global
111+
execution mutex and must satisfy both interface contracts. If both interfaces
112+
refer to the same complete object, their shared pointers must also share one
113+
ownership control block, checked in C++11 by symmetric `owner_before()`:
114+
`!backend.owner_before(formatter) && !formatter.owner_before(backend)`.
115+
Independent control blocks for that same object are rejected before publication.
116+
Distinct complete objects sharing one control block remain valid. No global
112117
object-lock registry or new hot-path synchronization is introduced in v1.
113118

114119
The prepared set remains caller-owned after successful registration. Clearing
@@ -240,6 +245,7 @@ No implementation of the registration or shutdown changes is part of this PR.
240245
| Shared formatter pointer under two different IDs | Reject the whole batch; no log/format invocation or object state change during validation. |
241246
| Runtime object reused in a later batch | Reject even with a fresh ID; include aliasing against legacy entries and different interface subobject addresses. |
242247
| Distinct objects sharing one control block | Do not falsely reject solely because shared ownership has the same control block. |
248+
| Combined backend/formatter object in one strategy | Accept only with one shared ownership control block; reject independent control blocks for the same complete object without publication. |
243249
| Manually constructed prepared set | Reject unsupported schema, empty/duplicate IDs, null objects, invalid level/options, and unknown option IDs without publication. |
244250
| Snapshot allocation failure in batch registration | Mutable registry, ID map, dispatch snapshot, prepared input, and old result remain unchanged. |
245251
| Returned ID/index result allocation failure | No publication or partial mapping; old caller result remains unchanged. |

0 commit comments

Comments
 (0)