Re: RDTSC



Herbert Kleebauer wrote:
Frank Kotler wrote:

Herbert Kleebauer wrote:

Well... the "latest version" of "my code" changed things quite a lot...
"read"/"write" instead of "recv"/"send"...

Do you know if they are completely interchangeable or are there
some differences? Would read/write also work for a TCP connection
to the X server?

I don't know. I assume there are some differences, although they seem to work pretty much the same in this case. Looking at the man page, there seem to be some interesting flags available to "recv" that don't exist for "read" (AFAIK). "MSG_DONTWAIT" looks like it causes "recv" to be non-blocking on a call-by-call basis, for example. Or "MSG_WAITALL"... I don't know how to use 'em.

I only went with read/write because I'm familiar with 'em, and they seem to be what Xlib uses. Xlib also uses readv/writev. I haven't tried these, but I think I see how they work. For the "connection request", for example, instead of copying the authorization "protocol name" and "protocol data" to a single buffer, we can write a few bytes of "header", a few bytes of "name" and a few bytes of "data" right from where we read (or mmapped) ".Xauthority" - all in one sys_call. Might be an advantage...

I still don't like the X thing. There must be some other, more native
interface to the graphics card.

Have you worked with the "framebuffer device" at all? That seems more
"native" to me, but doesn't play nicely with X, it seems...

I mean a interface to the X server.

Ah.

Something like XDraw in Windows.

I don't know XDraw... give us direct access to the LFB (assuming we have one)? I don't think there could be anything like that in Xwindows, since it all has to be sent through the socket. The display might be on another machine, y'know. I think we'd need to escape this assumption if we wanna go fast.

How do real time games screen output in Linux (or are there no such
games for Linux)?

I'm not a "gamer", so I don't know what's available (or how they do it). I don't think Linux is considered a desireable game-platform, but I don't know how bad it is.

Can't believe, that a movie player uses
X's PutImage to display the video (wouldn't this be much to slow?).

Doing this with a demo that Wilhelm posted, I see a lot of writes in 16k
chunks, so that may be the way to go...

Before or after you reconfigured the X server? If after, that would
mean the software (I suppose Xlib) only uses the guaranteed 16 kbyte
instead of the within the connect message reported actual value (max. 256 kbyte).

Both before and after, and on the K6, the "maximum request" was 64k, and Xlib seems to write 16k units...

Best,
Frank
.



Relevant Pages

  • switching user after kde 3.4 update
    ... Protocol not supported by server ... Xlib: connection to ":1.0" refused by server ...
    (alt.os.linux.suse)
  • freebsd5.2 and kdm - what is wrong?
    ... i've added 'exec startkde' to .xsession, ... Xlib: connection to ":0.0" refused by server ...
    (freebsd-questions)
  • Problems with MIT-MAGIC-COOKIE-1 / xauth / xhost
    ... I'm having problems with running XWindows applications from one of my ... Xlib: connection to ":0.0" refused by server ... authentication off, I tried xhost +, but got a similar error message: ...
    (comp.os.linux.setup)
  • Re: Problem with using sleep in a loop
    ... Xlib implements an asyncronous communication model with the X server. ... request, that request is appended to a local request buffer. ... XFlush flush the request buffer, forcing their transmission, and return ...
    (comp.unix.programmer)