[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1154093606.19722.11.camel@localhost.localdomain>
Date: Fri, 28 Jul 2006 09:33:26 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Theodore Tso <tytso@....edu>
Cc: Neil Horman <nhorman@...driver.com>,
"H. Peter Anvin" <hpa@...or.com>,
Segher Boessenkool <segher@...nel.crashing.org>,
Dave Airlie <airlied@...il.com>, linux-kernel@...r.kernel.org,
a.zummo@...ertech.it, jg@...edesktop.org
Subject: Re: A better interface, perhaps: a timed signal flag
On Wed, 2006-07-26 at 10:45 -0400, Theodore Tso wrote:
> If we had such an interface, then the application would look like
> this:
>
> volatile int flag = 0;
>
> register_timout(&time_val, &flag);
> while (work to do) {
> do_a_bit_of_work();
> if (flag)
> break;
> }
This wouldn't work simply because the timeout would most likely be
implemented with an interrupt, and the address of flag is in userspace,
so the interrupt handler couldn't modify it (without doing some sort of
single handling, and thus slow down what you want).
What you could have is this:
volatile int *flag;
register_timeout(&time_val, &flag);
while (work_to_do()) {
do_a_bit_of_work();
if (*flag)
break;
}
Where the kernel would register a location to set a timeout with, and
the kernel would setup a flag for you and then map it into userspace.
Perhaps only allow one flag per task and place it as a field of the task
structure. There's no reason that the tasks own task sturct cant be
mapped read only to user space, is there?
-- Steve
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists