nanogui: Thread: THREADSAFE and NONETWORK


[<<] [<] Page 1 of 1 [>] [>>]
Subject: THREADSAFE and NONETWORK
From: Alexander Neundorf ####@####.####
Date: 14 Dec 2005 21:20:32 +0000
Message-Id: <200512142220.07112.neundorf@kde.org>

Hi,

short question: which effect have these two defines ?
IOW, if everything runs in one process space, but in multiple threads, I guess 
both NONETWORK and THREADSAFE are required. Why is THREADSAFE translated to 
THREADSAFE_LINUX in lock.h ?

#if THREADSAFE
#define THREADSAFE_LINUX	1	/* use linux threadsafe routines*/
#endif

And what has to be protected by the locks ?

Bye
Alex
-- 
Work: ####@####.#### - http://www.jenoptik-los.de
Home: ####@####.####                - http://www.kde.org
      ####@####.####               - http://www.neundorf.net
Subject: Re: [nanogui] THREADSAFE and NONETWORK
From: Alexander Neundorf ####@####.####
Date: 14 Dec 2005 21:35:13 +0000
Message-Id: <200512142235.00890.neundorf@kde.org>

On Wednesday 14 December 2005 22:20, Alexander Neundorf wrote:
> Hi,
>
> short question: which effect have these two defines ?
> IOW, if everything runs in one process space, but in multiple threads, I
> guess both NONETWORK and THREADSAFE are required. Why is THREADSAFE
> translated to THREADSAFE_LINUX in lock.h ?
>
> #if THREADSAFE
> #define THREADSAFE_LINUX	1	/* use linux threadsafe routines*/
> #endif

And does it have to be a recursive mutex ? Or does a "normal" one suffice ?

Alex
-- 
Work: ####@####.#### - http://www.jenoptik-los.de
Home: ####@####.####                - http://www.kde.org
      ####@####.####               - http://www.neundorf.net
Subject: Re: [nanogui] THREADSAFE and NONETWORK
From: "Greg Haerr" ####@####.####
Date: 15 Dec 2005 01:40:08 +0000
Message-Id: <0b8b01c60118$5385ac30$6401a8c0@winXP>

: short question: which effect have these two defines ?
: IOW, if everything runs in one process space, but in multiple threads, I
guess
: both NONETWORK and THREADSAFE are required.

Yes.  NONETWORK means LINK_APP_INTO_SERVER,
THREADSAFE is used to block threads entering GrXXX
function calls.


 Why is THREADSAFE translated to
: THREADSAFE_LINUX in lock.h ?
:
: #if THREADSAFE
: #define THREADSAFE_LINUX 1 /* use linux threadsafe routines*/
: #endif

I think it is for Linux's threads header file, which gives a
better pthreads implementation with the kernel.

Regards,

Greg

Subject: Re: [nanogui] THREADSAFE and NONETWORK
From: "Greg Haerr" ####@####.####
Date: 15 Dec 2005 01:45:09 +0000
Message-Id: <0b8e01c60118$99093c40$6401a8c0@winXP>

: And does it have to be a recursive mutex ? Or does a "normal" one suffice
?

I was tracing this out once, and thought that I was glad we were using
recursive (multi-entrant, couning) mutexs.  I'm not sure anyone
has guaranteed simple ones will work by following nested
procedure calls in nanox/client.c.  Note, however, that
no actual GrXXX calls are pre-empted and reentered, just
possible the routines underneath them.

Regards,

Greg

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.