-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[core] Introduce IOContextProvider and its Policy #48231
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
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.
this is great love the TMP
Signed-off-by: Ruiyang Wang <[email protected]>
Thanks @dayshah for the valuable suggestions! Applied most, except for one: we still need the unique_ptr because the InstrumentedIOContextWithThread has no default ctor so we can't easily init it in an array. |
Signed-off-by: Ruiyang Wang <[email protected]>
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.
Nice
src/ray/gcs/gcs_server/gcs_server.h
Outdated
@@ -206,18 +207,12 @@ class GcsServer { | |||
|
|||
void TryGlobalGC(); | |||
|
|||
IoContextProvider<GcsServerIoContextPolicy> io_context_provider_; |
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.
Should we introduce a factory method in a separate file like https://github.com/ray-project/ray/blob/master/python/ray/serve/_private/default_impl.py
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.
hmm I think that'd be too elaborate since the only difference is this 1 line
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.
ok, let's keep as it is and revisit it if it will cause merge conflicts.
Signed-off-by: Ruiyang Wang <[email protected]>
GcsServer manages several IO Contexts and their threads, and hard codes which class uses which IO Context. This is not flexible in that we can't easily declare another IO Context and adapt some classes without a pervasive code change.
Introduces an IoContextProvider that manages IO Contexts based on a static, compile-time Policy, whose author can determine class-IO Context mapping. This way we can change the mappings in a central place without big chunk of changes everywhere.