Filed under Threepwood

More on linuxfd: An Example

The following short test program demonstrates the possibilities of eventfd, signalfd and timerfd in an asynchronous controlled event loop. In short this program features a loop which is activated if any of the three special files becomes readable. Otherwise the epoll call blocks indefinitely. Every three seconds a timer file object expires, thus becoming readable. … Continue reading

From pytimerfd to linuxfd

Recently I have released Python bindings for the timer file descriptor available in Linux (pytimerfd). Now I can present the Python package “linuxfd”, which offers Python bindings for the Linux system calls eventfd, signalfd and timerfd. It is available at pypi.python.org and at GitHub: https://pypi.python.org/pypi/linuxfd/1.0 https://github.com/FrankAbelbeck/linuxfd With “eventfd” it is possible to define counter files … Continue reading

Clear sys.stdin Buffer

With epoll() it is possible to detect whether sys.stdin (the standard input character stream) is readable (i.e. someone typed something and concluded with <enter>). Standard input then can be obtained by calling sys.stdin.readline(). But it is not that trivial to get the last input line because sys.stdin is buffered. The user might have entered some … Continue reading

Python Bindings for timerfd.h

For my PhD thesis I’m working on event based control systems. Asynchronous I/O is needed, and so I rely on epoll(), a notification mechanism for file descriptors in Linux systems. As (nearly) everything in Linux can be described as a file, epoll() is able to monitor various I/O interfaces like GPIO or network sockets. It’s … Continue reading