-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CP-52745: Add ThreadLocalStorage
in Threadext
#6354
Merged
psafont
merged 1 commit into
xapi-project:master
from
GabrielBuica:private/dbuica/CP-52745
Apr 11, 2025
Merged
CP-52745: Add ThreadLocalStorage
in Threadext
#6354
psafont
merged 1 commit into
xapi-project:master
from
GabrielBuica:private/dbuica/CP-52745
Apr 11, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please, explain the benefits of the change in the PR and the commit message |
b4e984b
to
e8dbeb8
Compare
minglumlu
reviewed
Mar 18, 2025
minglumlu
reviewed
Mar 18, 2025
minglumlu
reviewed
Mar 18, 2025
minglumlu
reviewed
Mar 18, 2025
edwintorok
reviewed
Mar 18, 2025
edwintorok
reviewed
Mar 18, 2025
contificate
reviewed
Mar 18, 2025
e8dbeb8
to
0645f28
Compare
baa4967
to
a6cb96f
Compare
edwintorok
approved these changes
Apr 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we now have a user of this code, and the interface is simpler.
a6cb96f
to
ab1257f
Compare
Adds a `ThreadLocalStorage` module under `Threadext`. Currently, it uses `Ambient_local.Thread_local` as the underlying implementation. Following the thread classification PRs, xapi-project#6154, this will enable accessing the current thread group for each thread. The current data structure contains the following: 1. ocaml_tid 2. thread_name 3. time_running 4. tepoch 5. tgroup Field 1: `ocaml_tid` is equivalent to `Thread.self () |> Thread.id.` Field 2: `thread_name` is to associet threads with human readable string. Fields 3-5: - `time_runinng` - the amount of time the thread has been running in the current OCaml runtime timeslice, - `tepoch` - the current timeslice the thread has been scheduled for, - `tgroup` - current thread classification. Fields 3-5 are what is expected to be used for thread scheduling when xapi is under load. This can be extended in the future to contain information about tracing, such as `traceparent` and `baggage`. Signed-off-by: Gabriel Buica <[email protected]>
ab1257f
to
f2b848d
Compare
psafont
approved these changes
Apr 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a
ThreadLocalStorage
module underThreadext
. Currently, ituses
Ambient_local.Thread_local
as the underlying implementation.Following the thread classification PRs, #6154, this will enable
accessing the current thread group for each thread. The current data
structure contains the following:
Field 1:
ocaml_tid
is equivalent toThread.self () |> Thread.id.
Field 2:
thread_name
is to associet threads with human readablestring.
Fields 3-5:
time_runinng
- the amount of time the thread has been running inthe current OCaml runtime timeslice,
tepoch
- the current timeslice the thread has been scheduled for,tgroup
- current thread classification.Fields 3-5 are what is expected to be used for thread scheduling when
xapi is under load. (This will be a future PR.)
This can be extended in the future to contain information about tracing,
such as
traceparent
andbaggage
.