The XYZ server extension implementation by the author
is designed to be easily portable
to X11 server implementations based on MIT's X11 distributions.
The server-side and client-side code should be able to be dropped in any X11R4 or X11R5 derived server and/or X extension
library.
The server code for the extension is implemented to use
a standard bucket hash table for managing the tag space.
Tags not found in the hash table are assumed to have the default
value of zero and trace level of 255.
The main performance issue for XYZ is the execution speed of the
XYZ macro. If the macro is too expensive, server implementors
will shy from using the XYZ facility.
In particular, the execution
of the XYZ macro should only perform a hash table look up
on named tag name if it has not already done so. Each instance of
the XYZ macro maintains static state (a small structure) used for this
purpose. If the static state does not already contain a reference
to the named tag, a hash table look up will be performed and the
static state will be updated to contain a reference to the named tag.
Then subsequent calls can use the previously looked up tag reference.
Note that entries in
the hash table can be removed. In this case,
XYZ must invalidate all the cached static look ups for the tag
being removed.
The implemented
client programmers interface for XYZ is described in Appendix A.
The author has implemented the interface on top of the Xlib library.
A disadvantage of this approach is that IO errors
due to the lost of a server connection are nearly impossible
to recover from in the current Xlib architecture. (The
XSetIOErrorHandler function allows for detection but not
adequate opportunity for recovery.)
This means if
a server crashes which is being monitored by a client using XYZ, the XYZ
client is forced to terminate as a result of the lost connection.
The XYZ client programmer interface could be reimplemented to avoid
this difficulty and probably will be in the future.
Also because the current XYZ client library is implemented on top
of Xlib, XYZ client programmers will want to override the client-side
buffering
Xlib provides by default. XYZ requests
tend to demand immediate execution therefore buffering is not desirable.
The Xlib XSynchronize function should be used to turn off buffering
for an XYZ display connection.