[Soot-list] Help needed with ThreadLocalObjectsAnalysis
Arie Zilberstein
arie.zilberstein at gmail.com
Fri Sep 4 13:43:56 EDT 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090904/4a71d914/attachment.html
More information about the Soot-list
mailing list