Comments (4)
Too many open file
This error stands for you hitting soft cap on number of file descriptors
You can configure it by ulimit -n <new_cap>
Library code cannot work around this limit
I suppose that problem is in too many reassignments of interval variable.
In your code example I do not see many reassignments
Please note that Interval::wait
just performs restart of underlying timer, it doesn't re-created
Interval
:
https://github.com/DoumanAsh/async-timer/blob/master/src/interval.rs#L63-L66
TimerFd
:
https://github.com/DoumanAsh/async-timer/blob/master/src/timer/async_tokio1.rs#L200-L203
So if you run this task multiple times, I recommend to avoid doing so and instead limit intervals (if you cannot expect control over ulimit
)
If you want unlimited timers, it is better to use tokio
builtin timers even if they have lower accuracy, it is still pretty decent because on Linux it relies on epoll
from async-timer.
Thanks for your response.
I decided to increase ulimit for open files. Tokio timers have to low resolution for me as i drive stepper motors.
from async-timer.
Understood, but please note that while timerfd provides best latency, you should prefer to switch to real time scheduler
Even if Linux only imitates it, it stills provides much less opportunity for delayed wakeups than default scheduler.
I would also recommend to only use user space application as proof of concept, as it seems your goal is to develop driver rather than just simple application.
So driver might be more suitable as you avoid going through syscalls when manipulating hardware
from async-timer.
On site note, if you use sysfs interface you can benefit from using AsyncFd
to use async IO
https://docs.rs/tokio/1.32.0/tokio/io/unix/struct.AsyncFd.html
Most of the time sysfs file descriptiors are poll friendly because it is not real file, but rather special interface to access driver commands.
from async-timer.
Related Issues (10)
- arm32: Invalid conversion from i32 to u32 HOT 1
- 1.0.0: Final rewrite
- tokio policy HOT 1
- Std AsyncIterator HOT 1
- update tokio dependency HOT 2
- Investigate behavior of small timers on Apple platforms HOT 1
- Make Interval implement Stream HOT 1
- lots of errors for aarch64-linux-android HOT 8
- Spurious wakeups with timerfd + Interval HOT 8
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 async-timer.