Well, I've made a start on a kernel module implementing some wineserver-type
functionality, and I think that I've reached a reasonable point to put it up
for discussion.

Note that you will need one of the later development Linux kernels to use it
with (I use 2.4.0-test7) - I've attached the a tar-bzip2 archive of the code
to this document.

At the moment it does the following:

        CreateEvent
        OpenEvent
        PulseEvent
        ResetEvent
        SetEvent
        CreateMutex
        OpenMutex
        ReleaseMutex
        CreateSemaphore
        OpenSemaphore
        ReleaseSemaphore
        WaitForMultipleObjects (mostly)
        CloseHandle

Unfortunately, it can't actually be integrated into Wine just yet, since it
only supports three of the many 'kernel' object types, and WaitFor*() can't be
shared between implementations.

There's documentation included in the attached archive, including some rough
preliminary benchmarks. As a quick off the cuff reading, it beats Win2000 by
~3% and Wine by ~900% on a dual CPU box.

Note that WaitForMultipleObjects() is implemented internally in the same way
as poll and select, and thus is a restartable system call (can be interrupted
by signals).

I've pasted part of the Why? section out of my documentation:

WHY
===

Because the current wineserver interface involves each wine process making a
socket connection to a separate server process, which then arbitrates access to
synchronisation objects and various other things.

All this involves message passing and lots of process context switching
(slow). By moving this into the kernel, advantage can be taken of kernel
services for handling synchronisation, scheduling and concurrency.

As an additional minor benefit, the "strace" program can be modified to read
these specific system calls.

===

So comments please...

Have fun,
David Howells

wineserver kernel module source

Reply via email to