-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use SEND_ONCE mach rights for async, use a queue limit of 1
SEND_ONCE allocates a mach port with a SEND right exactly once and deallocates it automatically once the message is read. This is totally wasteful because we have a perfectly good mach port already... This commit adds the send right to our existing mach port and reuses it for each send. This avoids any port allocations. We additionally call mach_port_set_attributes to set the queue limit for the mach port to 1. We don't need to allocate and queue a bunch of messages when all we need is 1 to wake up. This should speed up notifications AND waiting because draining will only ever drain 1.
- Loading branch information
Showing
1 changed file
with
46 additions
and
3 deletions.
There are no files selected for viewing
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