-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make DmaFile and OwnedDmaFile clonable (#657)
The current mechanism for sharing an FD with a background thread requires `dup` which can limit how many references to a file can exist concurrently in background threads. The use-case is a file server that responds to requests by handing back an FD and a region to respond with - using `dup` limits how many concurrent requests can be referencing the file at once due to kernel limits on simultaneous open FDs. However, by letting DmaFile be clonable, it lets us send the FD to any thread without risking race conditions about the FD closing while references exist. This does have a new consequence that close requests may fail if clones exist, but this only impacts those who actually try to clone in the first place, so should have no impact on existing users. Co-authored-by: Glauber Costa <[email protected]>
- Loading branch information
Showing
5 changed files
with
253 additions
and
38 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
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
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
Oops, something went wrong.