:I have two threads in my application. I have compiled microwindows with
: LINK_APP_INTO_SERVER=Y and THREADSAFE=Y . When I using GrGetWindowInfo
: in second thread , this thread is frozen . Why ? Is there any solution
: for this problem ?

The nano-X client/server protocol and client lib wasn't designed
for multi-threaded applications, but was made to work later
by adding mutexes around each call, which is what THREADSAFE
enables.  The mutexes were added so that a thread isn't preempted
before writing all the protocol data to the server, which would
cause desynchronization and packet corruption.

There are still sometimes issues when multiple threads are used with
GrXXX calls which require a server round trip (that is, require 
return data).  GrGetWindowInfo is one of these.

In your case, the server is linked with the application.  The original
implementation of THREADSAFE was concerned only about
protecting client library threads, while the server ran asynchronously.
Your program will execute the "server" side synchronously.  There
may be some cases where deadlock could occur (I'm not coming
up with any specific cases right now)

I would recommend that only one thread make calls that return
return information, and/or make these calls early in the initialization
portion and save the results in static data.

Hope this helps.

Regards,

Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: nanogui-unsubscr...@linuxhacker.org
For additional commands, e-mail: nanogui-h...@linuxhacker.org

Reply via email to