Re: PROOF and static data members

From: Margar Simonyan <margar.simonyan_at_gmail.com>
Date: Tue, 22 Mar 2011 08:48:43 +0100


Hello Fons

thanks. I think your statement that static members are not shared between processes is what I need. To elaborate more, I have something like this:

class A
{ static int n; }

class B: public A

class C: public A

Class B is responsible for reading TTree and does SetBranchAddress using A::n. I was not sure what happens when there are multiple processes running on a multi-core machine.

Best regards,

      Margar

On Mon, Mar 21, 2011 at 5:01 PM, Fons Rademakers <Fons.Rademakers_at_cern.ch> wrote:
> Hi Margar,
>
>   you have to make sure these static data members get properly initialized,
> which will normally be the case if you load a shared library (or a PROOF par
> package). But if you change these statics they are not automatically shared
> between processes when object instances are copied. You'll have to make sure
> you add the static values in the input list as parameters so the values can
> be set on all workers (if needed).
>
> Cheers, Fons.
>
>
> On 20/03/2011 23:55, Margar Simonyan wrote:
>>
>> Hello
>>
>> I am thinking about design of a set of classes with static data
>> members and plan to use these classes as a base in inheritance. The idea
>> is to
>> share the same pointers in multiple classes. Can such a design work
>> also with PROOF?
>>
>> Thanks,
>>     Margar
>>
>> P.S. Sorry if you get multiple copies of this e-mail, it seems my
>> previous posts were blocked.
>>
>> -------------------------------------------------------------------------
>>  Dr Margar Simonyan,  post-doctoral researcher
>>  Niels Bohr Institute, Copenhagen University
>> -------------------------------------------------------------------------
>>
>
> --
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
> WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
>
>
Received on Tue Mar 22 2011 - 08:48:51 CET

This archive was generated by hypermail 2.2.0 : Tue Mar 22 2011 - 11:50:01 CET