Skip to content

TListOf{Functions,DataMembers}::fIds might need thread protection #6566

Closed

Description

@Axel-Naumann

E.g. b1d5b97 improves the situation a bit, but in the end we're still left with many unprotected (threading-wise) accesses to both fIds and its content, i.e. addition / removal of elements might happen asynchronously. There are usages in the wild of direct access to fIds, e.g.

DataMemberInfo_t* t = gInterpreter->DataMemberInfo_Factory(did, nullptr);
((TListOfDataMembers*)gROOT->GetListOfGlobals())->Get(t, true);

Activity

  1. wlav commented on Oct 6, 2020

    @wlav
    Contributor

    A priori Python code is protected by the GIL, so this access wouldn't be an issue for threaded code (GIL release is ever only on the actual call into C++, not on any setup code to reach that point). Additionally, this is a workaround for ROOT/meta's buggy handling of enums. Since that is now fixed, this particular workaround is no longer necessary and can simply be removed.

  2. ferdymercury commented on Sep 18, 2025

    @ferdymercury
    Collaborator

    @guitargeek I saw you were updating/syncing clingwrapper (#19906), do you think this workaround could be removed as part of your (or a separate) PR and this issue closed? Thanks

  3. guitargeek commented on May 10, 2026

    @guitargeek
    Contributor

    This issue can be closed after the migration to the CppInterOp-based cppyy, as we don't use ROOT reflection features like TListOf::{Functions,DataMembers} anymore in cppyy.

  4. guitargeek commented on Oct 5, 2026

    @guitargeek
    Contributor

    Closing after #21261. The direct fIds access in cppyy's clingwrapper that motivated this issue is gone: PyROOT is now wired to the vendored cppjit stack and no longer uses TListOf::{Functions,DataMembers} internals. Read paths in the meta classes are protected by R__LOCKGUARD(gInterpreterMutex). Mutation paths are only reachable with gInterpreterMutex already held (dictionary load/unload in TClass), so per ROOT's global-interpreter-lock threading model no further protection is planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions