IgnoreClient question

Jesse Barnes jbarnes at virtuousgeek.org
Fri Jul 2 14:43:38 PDT 2010


On Tue, 29 Jun 2010 04:07:48 +0200
Mario Kleiner <mario.kleiner at tuebingen.mpg.de> wrote:

> On Jun 29, 2010, at 2:24 AM, Keith Packard wrote:
> 
> > On Tue, 29 Jun 2010 02:18:31 +0200, Mario Kleiner  
> > <mario.kleiner at tuebingen.mpg.de> wrote:
> >
> >> What i assume but didn't check is that xlib doesn't have a problem
> >> with getting replies out of sequence
> >
> > The X protocol is purely sequential -- you can't execute requests  
> > out of
> > order (and queuing replies is part of the request execution). In
> > particular, no X library would ever deal with replies being  
> > returned out
> > of order; they count on the sequence number from the X server being  
> > monotonic.
> >
> 
> Ok, thanks. That makes live for multi-threaded clients a bit more  
> difficult if they want to use the new extensions, because they would  
> need to maintain multiple x connections, one for each thread, to  
> circumvent this. I guess then xcb doesn't handle this either?
> 
> Then i think the idea of multiple wait queues doesn't allow to get  
> rid of IgnoreClient(), but we will still need those wait queues in  
> addition to IgnoreClient() to handle multiple blocking requests for  
> one drawable from different clients / x-connections correctly.

Right, we have lists in the server now too, so it shouldn't be too hard.

> The current code assumes exactly one client / x-connection per  
> drawable. I think if we have multiple threads accessing the drawable  
> over separate connections then the current IgnoreClient() method will  
> not work and we will end up with undefined behaviour for some of the  
> new dri2 protocol requests.
> 
> E.g., what should work according to the spec is that i have multiple  
> threads, each of them using its own dedicated x-connection to perform  
> a glXWaitForSbcOML() or glXWaitForMscOML() or glXSwapBuffers()/ 
> glXSwapBuffersMscOML() call for the same drawable and getting its  
> request retired when the corresponding event happens. Currently  
> random stuff would happen if i tried this. If i remember correctly  
> the first thread making a request would be correctly handled and all  
> other threads would hang forever - their requests would disappear  
> into nirvana.
> 
> Anyway, this is a separate issue from IgnoreClient(), so i'll discuss  
> it separately with Jesse.
> 
> Another question: If i have separate x-connections, e.g., one for  
> each drawable and each connection has an opengl rendering context  
> attached to the drawable, then i assume these context still can share  
> state (display lists, shaders, texture objects, fbo's etc.), right?

Anything associated with the drawable would be shared, but context
specific information would still be separate per thread.  Display lists
can be shared explicitly, likewise for some of the other objects, so
you should be able to get the sharing you want.
-- 
Jesse Barnes, Intel Open Source Technology Center


More information about the xorg-devel mailing list