>>>>> "Sita" == Sita Tangirala <tangirala_madhu@...> writes:
Sita> I want to get the information about the sharing of objects
Sita> between threads. For this, I got information about the objects
Sita> that are created(I put a hook in the postAlloc() method). Then in
Sita> the reference count plan, I put a hook which can give me threads
Sita> which referenced the objects. By comparing, I thought I can make
Sita> out objects which are created by one thread and escape to other
Sita> threads. But Does this cover the entire sharing of objects? Can
Sita> anyone please explain me what I should be doing or what are the
Sita> scenarios that I should consider so that I can get the entire
Sita> sharing of objects.
Sita> One definete answer that I know is looking at the write
Sita> barrier. But I'm not sure whether it covers the entire
Sita> sharing. Can anyone please help me with this.
Reference counts and write barriers will not directly determine which
threads access which objects. Reference counts could determine which threads
create/delete pointers TO an object, but they could access an object
without creating new pointers, and they could create/delete pointers
without accessing the target object. Write barriers likewise.
Both reference counts and write barriers can tell you when a POINTER FIELD
of an object is WRITTEN, but that is not the same as accessing either,
since it omits consideration of reads, and of writes to non-pointer fields
and to the object header.
READ BARRIERS would get you some distance farther, but they would generally
be there only for pointer field accesses.
If you try to change the compilers to give more information (e.g., via
getfield/putfield (and array access) implementation), you will miss some
accesses (particularly to headers), and you lso have to be very careful NOT
to instrument your instrumentation code (or else you have infinite
regress).
A simulation environment might be the most reliable way to determine what
you're interested in. Most of these are single process, but since Jikes RVM
does its own thread switching in a single CPU environment, in theory you
could get the information you want. I believe our Dynamic SimpleScalar
environment could be tweaked to give what you want ... but I regret it is
not at this time publicly available. (We're in the process of cleaning up
and improving a host of divergent versions of it, but it will be a little
while yet before we can offer it back to the community at large. We also
have to check the legalities of HOW we can offer it. And it's for PPC
only.)
Maybe others on the list can come up with other alternatives for you.
Hope this is of _some_ help to you anyway .... Eliot Moss
|