[PATCH xserver 03/20] os: Implement support for NotifyFd X_NOTIFY_WRITE

Keith Packard keithp at keithp.com
Tue Nov 17 17:59:27 PST 2015


Adam Jackson <ajax at nwnk.net> writes:

> ISTR the server currently has a "write then read" strategy for deadlock
> avoidance (and accidentally better reliability when low on memory).  Do
> we want to do that here too, and if we do, do we split this into
> walking the list twice to enforce the order, in case a caller has both
> flags set?

There's no strong requirement, other than the server isn't allowed to
block on writes. I think what you're remembering is that X clients are
kindly requested to read when writes would block. Writing before reading
encourages deadlock in general, but does reduce buffering requirements.

We could enforce write-before-read ordering here by removing the read
flag from the mask when the write flag was set so that subsystems using
both read and write wouldn't wake while waiting for write
space.

However, given that one use of this function is for nested X servers
where the socket in question is an X client connection which requires
read-before-write behavior, I think it's pretty clear that we'll want to
leave this kind of policy decision to the subsystem using the fds.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20151117/1344af62/attachment.sig>


More information about the xorg-devel mailing list