[Soot-list] Help needed with ThreadLocalObjectsAnalysis

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Fri Sep 4 12:50:51 EDT 2009


Arie can you send us the complete examples? It's hard to tell form the
code fragment you send. In those cases details usually count.

Eric

2009/9/4 Arie Zilberstein <arie.zilberstein at gmail.com>:
> Hi,
>
>
>
> I'm experimenting with soot's ThreadLocalObjectsAnalysis class.
>
>
>
> I want to find out if a field of an object is thread-local or thread-shared
> within a method. I realize that this may change over the lifetime of a
> single method. Look at this example:
>
>
>
> Dummy d;
>
> static Dummy sharedDummy;
>
>
>
> private void test() {
>
>       d = new Dummy(); // d is thread-local
>
>       d.integer = 5;
>
>
>
>       sharedDummy = d; // publish d; it is not thread-shared
>
>       d.integer = 10;
>
> }
>
>
>
> I used the ThreadLocalObjectsAnalysis object, hoping that it would determine
> that the second write to d (d.integer=10) is to a field which is
> thread-shared, but for some reason, it deduced that the field is
> thread-local.
>
>
>
> I'm using the object like this:
>
> MhpTester mhp = new SynchObliviousMhpAnalysis();
>
>             ThreadLocalObjectsAnalysis tloa = new
> ThreadLocalObjectsAnalysis(mhp);
>
>             // later, given a value from a method
>
> boolean fieldIsThreadLocal = tloa.isObjectThreadLocal(value, method);
>
>
>
>
>
> I should note that, just before calling test(), I'm starting a thread which
> deliberately sets sharedDummy.integer to 20. That's why I expect the object
> stored in sharedDummy to be thread-shared.
>
>
>
> I would appreciate any help! Is this my misunderstanding? or a problem?
>
>
>
> Best,
>
> Arie
>
>
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list