David Howells <[EMAIL PROTECTED]> writes:
> Basically, I too am thinking of an intermediate approach...
>
> (1) Put the bits that call the server all into one place in the source (as is
> mostly done now). Note that the kernel module I have produced _entirely_
> implements the Mutex, Semaphore and Event system calls, so things like
> CreateMutex and WaitForMultipleObjects would have to go in there.
>
> (2) The kernel module takes over handle management, with no userspace
> intervention required. Reference counting, handle number allocation,
> etc. all done in kernel space.
>
> (3) Provide a sort of RPC mechanism for those services that are impractical to
> implement in kernel space (such as the registry). I've outlined such a
> mechanism in an attachment to this message.
I'd advocate the opposite approach: rather than move everything in the
kernel, except for the few things that are too complicated, I'd
suggest moving to the kernel only the strict minimum necessary to
achieve acceptable performance. We don't need to beat Windows at raw
mutex performance, and maintaining two complete implementations of the
server is not realistic IMO.
I think what we need is:
- on the client side, a wake_server_and_sleep() call that combines the
write()+read() on the socket in a single syscall.
- on the server side, a wake_client_and_wait_for_next_one() that wakes
the client whose request was last processed, and waits until some
other client sends a request.
This should enable doing a complete server round-trip with only two
syscalls (one in the client one in the server), and avoid any
unnecessary context switch.
If we combine this with an efficient way to read/write the client
memory space from the server, I think we should be able to achieve
good performance while still reusing nearly all the existing code.
And if the mechanism is small enough and generic enough, we can even
hope to have it included in the standard kernel, which I doubt would
ever be possible with the complete server kernel module.
--
Alexandre Julliard
[EMAIL PROTECTED]