Skip to content
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

suspend PriorityQueue when no message is available(fix #14) #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

karino2
Copy link

@karino2 karino2 commented Jul 14, 2024

Now PriorityQueue::deque() becomes async and always return MessageContainer and never return nil. When no message is available, sleep with withCheckedContinuation until new message is comming.

With this change, HPRTMPExample CPU load becomes 14% for my iPhone 14 pro (previous: more than 100%).

Now PriorityQueue::deque() becomes async and always return MessageContainer and never return nil.
When no message is available, sleep with withCheckedContinuation until new message is comming.

With this change, HPRTMPExample CPU load becomes 14% for my iPhone 14 pro (previous: more than 100%).
@karino2 karino2 mentioned this pull request Jul 14, 2024
Fix of [2d5ebda] does not handle task cancellation.
withCheckedContinuation block forever, which cause memory leak.
withTaskCancellationHandler break properly even if withCheckedContinuation is waiting.
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.

1 participant