nanogui: Another thread question


Previous by date: 12 Sep 2004 23:58:38 +0100 Re: linux framebuffer vs. linear video driver ???, Greg Haerr
Next by date: 12 Sep 2004 23:58:38 +0100 Re: learning microwindows, Greg Haerr
Previous in thread: 12 Sep 2004 23:58:38 +0100 Another thread question, Andy Jorde
Next in thread:

Subject: Re: [nanogui] Another thread question
From: "Greg Haerr" ####@####.####
Date: 12 Sep 2004 23:58:38 +0100
Message-Id: <0c2b01c4991b$ba3ec8a0$3eba46a6@winXP>

> I'm working on an application that relies heavily on FLNX and makes some
limited direct calls into NanoX itself. As long as I stay inside the FLNX
framework and make these function calls from there (even from signal
handlers) everything works fine. But when I start a separate thread and try
these calls, the thread gets blocked (or dies, I can't determine that) when
it hits the nxGlobalLock mutex.

> I'm not calling a complex function, in this specific case it is
GrLowerWindow. And the rest of the program happily runs on - it does not get
blocked.

In general, when you're running with THREADSAFE=Y, then Microwindows
executes a mutex before entering the otherwise potentially nonthreadsafe
code.  It's likely that one of your other threads is already in the
mutex when you execute the GrLowerWindow, and the new thread
hangs.

GrLowerWindow doesn't require a response from the server, so its
implementation normally just writes a code down the server socket.
However, the flush() to the socket only happens normally when a
response is required, or GrGetNextEvent is called.  Of course,
if two threads are currently writing the socket at the same time,
with some kernels the writes can get intermixed.  You might
try running without the THREADSAFE=Y option, otherwise
you unfortunately might have to synchronize your threads and have
only one thread make GrXXX calls.

Regards,

Greg



Previous by date: 12 Sep 2004 23:58:38 +0100 Re: linux framebuffer vs. linear video driver ???, Greg Haerr
Next by date: 12 Sep 2004 23:58:38 +0100 Re: learning microwindows, Greg Haerr
Previous in thread: 12 Sep 2004 23:58:38 +0100 Another thread question, Andy Jorde
Next in thread:


Powered by ezmlm-browse 0.20.