[PATCH 2/4] X event queue mutex

Keith Packard keithp at keithp.com
Thu Oct 2 18:53:09 PDT 2008


On Fri, 2008-10-03 at 02:01 +0200, Simon Thum wrote:

> It may be constructed, but IMO this means the queue size is not fully 
> utilizable given head is 'old':

Yes, that's fairly common in queues -- you often can't use the last
entry. Not a huge deal if you make the queue big enough.

> BTW, given SMP visibility, isn't it a tiny bit risky to have 3 
> 'independent' miEventQueue.head reads in miEnqueue?

Given the old 'SIGIO' based code, it didn't matter. Even now, it doesn't
really matter as in the worst case we fail to store an event when the
queue is nearly full but the server is processing events.

> (b) may suffice. Locking the queue in OsBlockSigs() should do it and fix 
> most miEnqueue users.

Or just lock the queue in mieqEnqueue itself; keeping the lock near the
code seems like a lot better plan to me.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20081002/46a52740/attachment.pgp>


More information about the xorg mailing list