gomp-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gomp-discuss] CIL representation ...


From: Diego Novillo
Subject: Re: [Gomp-discuss] CIL representation ...
Date: 12 Mar 2003 09:27:40 -0500

On Wed, 2003-03-12 at 08:48, Biagio Lucini wrote:
> On Wed, 12 Mar 2003, [iso-8859-1] Pop Sébastian wrote:
> 
> > 12.6.7 defines volatile reads and writes that is exacltly what we have
> > to deal with when OpenMP says shared variables: in other words variables
> > visible across all threads.
> 
> I think (tell me if I am wrong) that for a shared memory system (I believe
> that we can't be "general" to the extend of tackling all the concurrent
> model in one go) the general building blocks are
> a) shared variables
> b) private variables
> c) locks
> d) synchronisation
> 
e) Memory coherency model.

Variables may be shared across threads, but you may still not be able to
see what other threads write.  This can be an advantage and a problem
for the compiler.  (c) and (d) are the same thing.

You also need to know the parallel model.  Having fork/join and parallel
loops is more than enough to build most concurrent programs.


> Questions: how does the actual optimising phase of gcc deals with Posix
> Threads (if it does it at all)?
> 
It doesn't.  When you use posix threads, it is your responsibility to
implement thread safe functions.  That means using volatile variables,
locking, etc.


Diego.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]