Passing tokens between threads
guanxiaohua at gmail.com
Thu May 6 11:59:00 PDT 2010
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.
Tony (Xiaohua Guan)
On Wed, May 5, 2010 at 8:28 PM, David Holmes <David.Holmes at oracle.com> wrote:
> 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