Skip to content

Add 'Thread Safety' documentation - #361

Merged
xlamorlette-datadog merged 9 commits into
mainfrom
xlamorlette/embed-thread-safety-doc
Sep 1, 2026
Merged

Add 'Thread Safety' documentation#361
xlamorlette-datadog merged 9 commits into
mainfrom
xlamorlette/embed-thread-safety-doc

Conversation

@xlamorlette-datadog

@xlamorlette-datadog xlamorlette-datadog commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Description

Embed the 'Thread Safety' documentation, which was firstly written as an internal documentation in Thread Safety (dd-trace-cpp).

Motivation

This documentation is both for the library users and maintainers.

Additional Notes

  • This is a copy of the internal documentation (linked above) with only very minor modifications.
  • The internal documentation will be deleted once this PR is merged, and the few sections at the end that don't belong to this public documentation will be moved elsewhere.

Jira ticket: IDMPL-550 C++ Tracer: investigate and document thread-safety.

@pr-commenter

pr-commenter Bot commented Aug 31, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-01 16:17:40

Comparing candidate commit 26fc882 in PR branch xlamorlette/embed-thread-safety-doc with baseline commit b258927 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 8 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@xlamorlette-datadog xlamorlette-datadog changed the title Fix various minor typos Add 'Thread Safety' documentation Aug 31, 2026
@xlamorlette-datadog
xlamorlette-datadog marked this pull request as ready for review August 31, 2026 14:08
@xlamorlette-datadog
xlamorlette-datadog requested review from a team as code owners August 31, 2026 14:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T14:20:18.174275Z f59d140 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f59d140594

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/thread-safety.md
Comment thread docs/thread-safety.md
Comment thread docs/thread-safety.md
Comment thread docs/thread-safety.md
Comment thread docs/thread-safety.md Outdated
Comment thread docs/thread-safety.md
Comment thread docs/thread-safety.md Outdated
Comment thread docs/thread-safety.md
Comment thread docs/thread-safety.md Outdated

@zacharycmontoya zacharycmontoya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, though the agent review has some good insights worth considering and documenting

@xlamorlette-datadog
xlamorlette-datadog force-pushed the xlamorlette/embed-thread-safety-doc branch from a9e2724 to 26fc882 Compare September 1, 2026 16:11
@xlamorlette-datadog
xlamorlette-datadog merged commit 83cbde0 into main Sep 1, 2026
38 checks passed
@xlamorlette-datadog
xlamorlette-datadog deleted the xlamorlette/embed-thread-safety-doc branch September 1, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants