gomp-discuss
[Top][All Lists]
Advanced

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

Re: [Gomp-discuss] A Simple PThread Example of OpenMP


From: Diego Novillo
Subject: Re: [Gomp-discuss] A Simple PThread Example of OpenMP
Date: Wed, 14 Apr 2004 12:42:56 -0400

On Wed, 2004-04-14 at 12:28, Biagio Lucini wrote:

> To my mind, the second should be easier, but I have the problem that I don't 
> know very well gcc trees. The problems I see concern propagation of the 
> variables: when we transform the code (whatever that will mean in the end) we 
> will have to take the code between braces following a pragma and change it 
> into a function, which should know the type of the different variables (being 
> an independent function). Is there an easy way of getting that from the 
> symbol table? Also, how do we modify the symbol table in such a way that we 
> can allocate copies of the private variables for each thread?
> 
There is a variety of code insertion functions in tree-ssa.  I will be
talking about this at the summit (working on the paper atm).  For the
time being you could browse through the various tree-*.c files.  Look
for instances of bsi_insert_before, bsi_insert_after, create_tmp_var,
etc.  A relatively clean file to look at is tree-sra.c

> Question for the middle-ender: we have said several times that the same 
> optimisation procedures that work for serial code do not work for parallel 
> code. Now, what does the gcc middle-end currently do with pthreaded programs? 
> Just skip optimisation?
> 
It's up to the programmer to sprinkle 'volatile' here and there and/or
synchronize accordingly.  The compiler has no knowledge of concurrency
semantics on shared data.


Diego.





reply via email to

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