Subject: Re: O_ASYNC on ttys
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Bill Studenmund <wrstuden@zembu.com>
List: tech-kern
Date: 07/09/2001 17:37:19
On Mon, 9 Jul 2001, der Mouse wrote:

> >>> then started dumping characters at it.  Of course, they came back
> >>> at 240Hz, just as I wanted.
> >>> I'm surprized that works.  Are you sure you're getting 240Hz
> >>> wakeups?
> (As I think I said, yes, I am.  Instrumenting the code indicates
> 235-245 wakeups per second, from a userland POV.)
> >> [W]ith low speed i think serial port sends one interrupt per
> >> character.  so why it shouldn't work?
> > Because there's a difference between 240 interrupts per second and
> > 240 wakeups per second.  The difference is the scheduler.
> 
> Yes, that concerned me a little.  Fortunately the concern seems to have
> been unnecessary; as I indicated, I was getting just about 240Hz
> wakeups in userland.

I bet what was happening was that the system was lightly loaded, and that
your process was the only one really running. So the processor was going
from running your process to idle & backa again. In that case, you
probably will be able to get more wakeups than HZ.

> > If one tick is 10 ms (100 Hz), and there's a process running when the
> > interrupt comes it, there's a good chance the process running will
> > get to finish its tick.
> 
> This is not an issue for my application; performance with other
> processes wanting the CPU is not expected to be acceptable (though it
> would be Cool if it were).

Cool. To make it work w/ other processes around, you'd need something like
runtime scheduling - you'd need the ability to yank the processor away
from the running process and have it send the signal to your process.

Take care,

Bill