Skip to content

Make FORM's write path thread-safe independent of Phlex #840

Description

@coderabbitai

Summary

FORM's write path currently has no internal locking. It relies on Phlex registering the output node with concurrency::serial to serialize writes.

FORM must be thread-safe independently of Phlex scheduling. The write path does not need to be concurrent by default.

Required work

Add FORM-owned synchronization for the write path.

Possible solutions include write-path mutexes that follow the existing read-side mutex pattern:

  • root_tbranch_read_mutex
  • root_rfield_read_mutex

Audit other write-path call sites that require synchronization.

Scope

This issue is independent of #834, which tracks row-index handling for a future ROOT::RNTupleParallelWriter implementation.

Affected areas

  • form/root_storage/
  • ROOT write containers
  • Storage and persistence writer call paths
  • Write lifecycle operations such as setup, fill, and commit

Acceptance criteria

  • FORM write operations are safe when callers invoke them from multiple threads.
  • The implementation does not depend on Phlex concurrency::serial for correctness.
  • The default implementation does not introduce concurrent writes unless explicitly designed to do so.
  • The audit identifies and protects relevant write-path shared state.
  • Tests cover the selected synchronization behavior.

References

Requested by: @wwuoneway

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions