-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Redo of Message Queue #75940
Redo of Message Queue #75940
Conversation
reduz
commented
Apr 11, 2023
•
edited by akien-mga
Loading
edited by akien-mga
- Functionality moved to a base class CallQueue, which will be used for inter-thread communication within the scene.
- MessageQueue now uses growing pages, starts from a single 4k page.
- Limit still exists, but because its not allocated by default, it can be much higher.
- Fixes Change MessageQueue to a page allocator to prevent overflow #35653
- Supersedes Make MessageQueue growable #62303 and Make MessageQueue growable #65740.
You're missing an empty line before the closing header guard :) This prevents the rest of the builds from running. |
ad79aaf
to
757a7ba
Compare
757a7ba
to
8bc2228
Compare
8bc2228
to
527131c
Compare
66afb49
to
f614101
Compare
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.
Looks good, besides a few comments I've added.
|
||
int room_needed = sizeof(Message) + sizeof(Variant) * p_argcount; | ||
_ensure_first_page(); |
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.
Can this be done at construction? (Maybe there's a reason for the non-message queues not to have the fixed penalty of 4Kb)
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 am not sure if I understand, but I just used 4k because its the most common value for operating system memory pages, so it can avoid fragmentation. I could have used 8k, but in practice it should not matter because no message should be that big I think.
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 was thinking there's no need for the "if check" here if it is done as a one off at construction.
5e7079d
to
8fd0523
Compare
Also looks fine to me. |
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.
Added new comments about minor things. Good to go in any case.
* Functionality moved to a base class CallQueue, which will be used for inter-thread communication within the scene. * MessageQueue now uses growing pages, starts from a single 4k page. * Limit still exists, but because its not allocated by default, it can be much higher.
8fd0523
to
6055e44
Compare
Thanks! |