Passing tokens between threads

David Holmes David.Holmes at oracle.com
Thu May 6 13:31:13 PDT 2010


Sorry Tony but I still don't know what you are trying to do. What is 
"co-relate"? What "thread triggering relationship" do you mean?

If you want to specialize allocation based on the thread then add a new 
field to the JavaThread class in the VM (or higher up if needed).

David

Tony Guan said the following on 05/07/10 04:59:
> Hi David,
> 
> Thanks for the reply.
> 
> Actually, my aim is to manipulate the mutator threads inside the VM,
> because my project is to cluster some threads together, to allocate
> the objects from the same group(not the ThreadGroup) in certain area
> of the heap.
> 
> Inside the VM, I don't quite know how to co-relate two thread together
> based on the thread triggering relationship.  This is what I am trying
> to figure out.
> 
> Thanks again!
> 
> 
> 
> Tony (Xiaohua Guan)
> 
> 
> 
> On Wed, May 5, 2010 at 8:28 PM, David Holmes <David.Holmes at oracle.com> wrote:
>> Tony,
>>
>> Tony Guan said the following on 05/05/10 02:03:
>>> In my current project, I need to be able to pass tokens between
>>> certain threads inside VM. While it's easy when Thread A is directly
>>> calling the Thread B's start().
>>>
>>> But usually, the thread B is not directly created and started by
>>> thread A, for example, thread pooling. In this case, if I need to pass
>>> a token from thread A to thread B(which is triggered by A), I guess I
>>> will need to monitor the object that B is waiting on.
>>>
>>> While I am still pondering over this, is there any other advice?
>> I don't quite understand what you are asking. In shared-memory
>> multi-threading the primary communication path between threads is
>> shared-memory. So passing a "token" is a matter of writing some data into a
>> memory location known to both threads. Then it is just a matter of how much
>> encapsulation/abstraction you want to put around that memory location.
>>
>> David Holmes
>>


More information about the hotspot-runtime-dev mailing list