Skip to content

fix: reduce thread contention in DC TableLoader#1238

Open
baltzell wants to merge 2 commits intodevelopmentfrom
dc-synchro
Open

fix: reduce thread contention in DC TableLoader#1238
baltzell wants to merge 2 commits intodevelopmentfrom
dc-synchro

Conversation

@baltzell
Copy link
Copy Markdown
Collaborator

@baltzell baltzell commented Apr 30, 2026

Remove unnecessary/ineffective synchronize locks and privatize methods.

The first 3 modified methods are only called once per event and only by the public, synchronized method TableLoader.Fill(IndexedTable ...). Since their sole caller is also synchronized, removing their own synchronized doesn't have any affect on thread contention or safety, just removes unnecessary locking. We can also make them private to help avoid confusion and misuse.

But the last 2, calc_Time and getDeltaTimeBeta, are called externally, later in each event, and maybe many times per event. Note, their locking isn't useful and does nothing to prevent the underlying data from changing during access or even since initialization; it only prevents multiple threads from calling the same reader method simultaneously.

@baltzell baltzell added the speed label Apr 30, 2026
@baltzell baltzell requested a review from raffaelladevita May 1, 2026 01:21
@baltzell baltzell changed the title fix: reduce DC thread contention fix: reduce thread contention in DC TableLoader May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant