[Xcb] Interning multiple atoms w/ one function call
(alla XInternAtoms)
Carl Worth
cworth at cworth.org
Thu Aug 11 08:18:13 EST 2005
On Wed, 10 Aug 2005 23:43:42 +0200 (CEST), Vincent Torri wrote:
> So, when the allocation fails, ok, I see why there are N
> round-trips.
Here's a time-line for N==4 with a round-trip latency (T_round_trip)
that is 5 times as long as the time required to write or read a
request/reply (T_write/T_read) [*].
W-----RW-----RW-----RW-----R
W: Writing request
-: Stalled, waiting for data
R: Reading reply
Total time: N * (T_write + T_round_trip + T_read)
> But when it does not fail, there are N requests for the N atoms. Then we
> ask for N replies. So we always ask N times the server. So i don't
> understand the improvement.
And here's the time-line for the two-loop version, again N==4 and the
same latency is in effect:
WWWW--RRRR
Total time: N * T_write
+ max (0, T_round_trip - ((N-1) * T_write))
+ N * T_read
So, as you can (hopefully) see, the two-loop version takes a worst
case penalty of one round-trip latency over the time required to just
write and read as fast as possible.
Does that help?
And do let me know if I botched the figures or equations anywhere.
-Carl
[*] I won't claim the proportions here are realistic. A small integer
ratio just happens to be convenient for the ASCII artwork. I have no
idea what the actual timing proportions are likely to be in a
real-world scenario, but an interested party can measure them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xcb/attachments/20050810/9535f90a/attachment.pgp
More information about the xcb
mailing list