Xlib: unexpected async reply

I"ve seached all the sdl list archives and haven’t found a clear
sollution.

Does anyone have any pointers on how to find what’s causing
" Xlib: unexpected async reply (sequence 0x604)! " error in my program??

I"ve seached all the sdl list archives and haven’t found a clear
sollution.

Does anyone have any pointers on how to find what’s causing
" Xlib: unexpected async reply (sequence 0x604)! " error in my program??

I had something similar in one of my progreams, the reason was a timer
was sometimes going off while the ‘main’ loop was doing stuff to the
display surface. It was a result of code that wasn’t threadsafe being
run by hidden threads :confused: I’d look for any threads or timers that might
try to screw with your gfx procedures at the same time as your real
display stuff.

    -Erik <@Erik_Greenwald> [http://math.smsu.edu/~erik]

The opinions expressed by me are not necessarily opinions. In all probability,
they are random rambling, and to be ignored. Failure to ignore may result in
severe boredom or confusion. Shake well before opening. Keep Refrigerated.

Hello everyone!

I have two thread running that updates my screen.

And sometimes, at various times, I get the error
message:
Xlib: unexpected async reply (sequence 0xXX)!

As I understand it, it has to do with the two threads
writing to the framebuffer at the same time. Is this
true!?!.

And ofcourse, are there any ways to “fix” this. I’m
figuring one might be able to “lock” the screen. If
this is so, I have several layers of SDL_Surfaces, do
I have to lock all of them or only one!?!?

Woulde very much appriciate an describing answer…

Sincirely
Martin

H?strusk och gr? moln - k?p en resa till solen p? Yahoo! Resor p? adressen http://se.docs.yahoo.com/travel/index.html

Hello everyone!

I have two thread running that updates my screen.

Think about what happens if one XLib call is stopped in the middle and
then another call takes place. The poor library gets very confused. Some
XLib functions wait for a reply before returning. Those functions are
likely to cause a thread switch. The now running thread can go do
another call that needs a reply. The reply to the first call in the
first thread can then come in and the second thread gets very confused.

Unless you want to wrap all you graphics call in a mutex to force single
threaded access to graphics, what you are doing will not work. Even if
you do wrap all the calls, the odds of it working are against you.

There really isn’t a “fix” for the problem because that is the way X is
designed. Usually when people run into this problem it is because they
are trying to use threads to avoid the problems working with state
machines. A goal I sympathize with, BTW. The thing to do is to use a
light weight cooperative threads package like the one described in “Game
Programming Gems”. That kind of “thread” doesn’t create an actual
thread, it is more of a coroutine system. There is only one real thread,
so no problems, but the code can be organized as if you had separate
threads. The result is much cleaner looking code.

Personally, I’m very comfortable with state machines.

	Bob PendletonOn Wed, 2003-09-24 at 03:15, Martin Holmgren wrote:

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

Xlib: unexpected async reply
i have 2 pc: the first witn suse8.1
the second with mandrake 9.2
I retrieve this error frequently only in mandrake 9.2 and very rarely on suse.
Xlib: unexpected async reply (sequence 0x34)
0x48 0x2a ecc…

i see that in threaded routin(like timer)i cannot use some function of sdl.

what are these?
i use SDL_Flip,SDL_RemoveTimer,SDL_AddTimer in my own timer function.
is this the error?

thanks.

Xlib: unexpected async reply
i have 2 pc: the first witn suse8.1
the second with mandrake 9.2
I retrieve this error frequently only in mandrake 9.2 and very rarely on
suse.
Xlib: unexpected async reply (sequence 0x34)
0x48 0x2a ecc…

i see that in threaded routin(like timer)i cannot use some function of
sdl.

what are these?
i use SDL_Flip,SDL_RemoveTimer,SDL_AddTimer in my own timer function.
is this the error?

thanks.