re: scheduling callbacks in user space triggered via kernel....

2001-05-22 Thread Daniel R. Kegel

Ashok wrote:
> Is there a method to schedule user mode code from
> kernel agent? ...
> windows 2000 offers 2 such facilities. (APC or async
> procedure calls) where a thread can block and when
> ready will be woken via the kernel agent and can run a
> user supplied function.
>
> or a method to bind a function to a file handle, when
> there is Completed IO, the kernel would call the
> registered function with a parameter of the buffer
> submitted for IO.

The traditional Unix way might be for user process to
call one of the blocking functions (read(), poll(), sigwait(), etc),
and have the kernel unblock the process in the usual way.

There is support for real async I/O on the horizon; see the SGI patch
at http://oss.sgi.com/projects/kaio/ if you need async I/O today.
Not sure this is what you're after, though.

Can you provide an example of how you want to use this?

For those who haven't read about this NT stuff, see
http://www.microsoft.com/msj/0499/pooling/pooling.htm
Even AS/400 is getting into this stuff; see
http://www.as400.ibm.com/developer/v4r5/api.html

- Dan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: scheduling callbacks in user space triggered via kernel....

2001-05-22 Thread Alan Cox

> Is there a method to schedule user mode code from kernel agent?

You can wake user processes,send them signals etc but ingeneral its not
a good idea

> registers with the kernel mode agent with a function/parm to run, then when
> the callback is appropriate the kerenl agent triggers this callback to
> happen.

The unix model is much more that the app does

while(1)
{
get_event(fd);
switcH(event)
{
..
...
}
}

> or a method to bind a function to a file handle, when there is Completed IO,
> the kernel would call the registered function with a parameter of the buffer
> submitted for IO.

The b_end_io callback can possibly be used, or Ben's asynchronosu callbacks,
but that deals with kernel level completion.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/