From: DervishD <lkml@dervishd.net>
To: Edgar Toernig <froese@gmx.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] /dev/itimer
Date: Sat, 29 Jul 2006 00:43:58 +0200 [thread overview]
Message-ID: <20060728224358.GA1824@DervishD> (raw)
In-Reply-To: <20060728235951.7de534eb.froese@gmx.de>
Hi Edgar :)
* Edgar Toernig <froese@gmx.de> dixit:
> Everytime I have to write code to do something at regular
> intervals I face the problem that the time routines on Unix
> are pretty archaic. Only a single process wide timer which
> notifies via signals. The single timer asks for a dedicated
> roll-your-own timer infrastructur, usually implemented via
> a lot of gettimeofday calls and appropriate select timeouts.
I wrote a timer multiplexor library a time ago, but it had
problems due to signals (if a SIGALRM was lost, the entire timer
multiplexor stopped), wasn't very precise and although portable, it
depended entirely on reliable signals.
With your /dev/itimer, ALL problems are gone. It's a very good
idea, simple to use, very practical and almost language independent.
You're an effin genius ;)))
I hope this goes into the kernel, because I'm not sure how to do
this from userspace reliably. My timer multiplexor library was just a
queue of events, with a SIGALRM raised when the nearest event
expired. When the signal was raised, the expiration time for the next
event is computed and the next SIGALRM is programmed to that time.
There is some precission loss :(( and sometimes a SIGALRM was missed
and the entire multiplexor stopped. I didn't investigate the issue
because I wanted a better solution instead of trying to beat a dead
horse ;)) This looks like a better solution! At least, I don't know
about any other timer multiplexor (or multiple timers for an
applicatoin) library or code.
Thanks a lot!, and good luck getting this into the kernel. Any
chance of it being backported to 2.4.x?
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to... RAmen!
next prev parent reply other threads:[~2006-07-28 22:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-28 21:59 [RFC] /dev/itimer Edgar Toernig
2006-07-28 22:33 ` Nicholas Miell
2006-07-28 22:44 ` Edgar Toernig
2006-07-28 23:14 ` Nicholas Miell
2006-07-28 22:43 ` DervishD [this message]
2006-07-28 23:01 ` Edgar Toernig
2006-08-01 14:40 ` Clemens Ladisch
2006-08-01 15:32 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060728224358.GA1824@DervishD \
--to=lkml@dervishd.net \
--cc=froese@gmx.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox