[SDL] Re: X11 again

Mattias Engdegård f91-men at nada.kth.se
Wed Apr 5 07:34:12 PDT 2000


>I'd really love to see latency below 10ms and bandwidth at least 30MB/sec...

10ms latency shouldn't be a problem even now, if you mean the time
between a mouse click and a button flash. You might even get it over a
network. Surely you have higher goals than that :-)

>NT got better performance under heavy loads
>thanks to some nasty scheduler tricks. Specifically, when a client sent a
>drawing request to the server, it could use a system call that would DEMAND
>the server thread to be run next, bypassing all other threads waiting for
>the CPU. One could theoretically implement this on Linux by, say, adding a
>system call to switch right to the server, instead of what the scheduler has
>planned.

Aw... just to get rid of a reschedule? I don't think it pays off.
If the only eligible process is the newly woken up X server, that is going
to be very fast anyway. The scheduler cost drowns in the cost of a context
switch (switch + TLB flush + cache effects).

>The obvious
>way around this is to share memory between client and server, as in X-SHM. A
>large enough shared segment could contain all drawing requests and bitmap
>data; then you could also switch to a simple semaphore as the IPC mechanism.

Many X servers already allow for using shared memory as a local transport
mechanism (XSun, for instance). But I don't think the gain isn't as large
nowadays since the sockets/pipes are highly tuned (I did some experiments
with it some time ago). MIT-SHM still pays off well, since it bypasses the
communication entirely.




More information about the SDL mailing list