Comments (5)
On Linux, we may supplement the RLIMIT_NOFILE datum with the number of entries in /proc/self/fd, since the number of entries in this directory indicates the number of file descriptors open.
This way, we don't have to count files open in file_accessor with the {in,de}crement_open_files functions either.
from tpie.
Jakob and I have tested two ways of measuring the number of files open:
- Testing all file descriptor numbers if fcntl returns an error (invalid file descriptor)
- Counting the number of entries in /proc/self/fd with opendir/readdir
For the first option, we first call dup(2) to get the first unused file descriptor. Then we count from there to the soft limit specified by getrlimit(2).
I will implement the first option. It seems that the two methods are equally fast within an order of magnitude. See https://github.com/Mortal/openfiles.
from tpie.
The first option seems to be the cleanest as well. I will test this on my branch shortly.
from tpie.
If there are no more issues with this, I guess we can close this issue.
from tpie.
Sounds good.
from tpie.
Related Issues (20)
- tuple_utils error HOT 4
- get rid of default_pred_sort_factory HOT 1
- turn factor constructed<dest_t>::type into constructed_type<dest_t>
- tpie reference not found HOT 4
- I/O efficient deque HOT 5
- Tpie rendering examples HOT 4
- internal data structures memory limit HOT 1
- I/O stack performance HOT 2
- peek_back for file_stream and peek for merge_sorter HOT 4
- Sorting of tpie::file<T>::stream HOT 2
- License exception for static linking HOT 4
- What's the status of this project? HOT 3
- tpie::priority_queue(mm_avail) not in documentation HOT 3
- Get CI back up to speed HOT 3
- merge_sorter::minimum_memory_phase_X() is lower than actual memory requirements HOT 1
- Resource memory limit exceeded for `tpie::priority_queue` HOT 2
- `file_stream::close()` does not terminate if TPIE has been Reinitialized
- `array_iter_base::advance` Should Take a `ssize_t` HOT 1
- Cannot compile tests with MSC 19.28+ HOT 2
- Cannot find the file "#include <tpie/tpie_export.h>" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tpie.