Greg Haerr
2007-09-12 06:18:39 UTC
Also, are you running a multithreaded application?
The Problem appears, when I am trying to do a lot of "focus in" and "focus
out". In fact, when I am switching two bitmaps, after a couple of times, itThe Problem appears, when I am trying to do a lot of "focus in" and "focus
is getting very slow until the "out of memory"/ "corrupted packet" message
appears...
The only easy fix to this issue will be to only allow additional
threads other than the main original thread to execute void GrXXX
functions (that is, typically draw functions) only, and allow ONLY
the main thread to execute non-void functions or any function that
could require a wait and/or a read from the server. In this way,
the THREADSAFE option protects the multiple threads doing
write-only client->server operations from stepping on each
other in the middle of a request, but the server->client
communication is read and processed only by a single
thread, the main thread.
BTW, the reason this can't be fixed given the current
protocol specification is that there isn't a standard-length
reply from the server, and there's only a basic queuing
mechanism in the client library. This means that any thread
reading the server pipe can't know how many bytes to
read, and thus may get interrupted and task switched
while in the middle of reading data from the server.
The next thread wakes up, does a read, and gets
unexpected crap from the middle of the previous
thread's response packet.
Regards,
Greg