Google Groups Home
Help | Sign in
Message from discussion Performance characteristics of mutable static primitives?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Rémi Forax  
View profile
 More options Apr 4, 4:46 am
From: Rémi Forax <fo...@univ-mlv.fr>
Date: Fri, 04 Apr 2008 10:46:07 +0200
Local: Fri, Apr 4 2008 4:46 am
Subject: Re: [jvm-l] Re: Performance characteristics of mutable static primitives?
John Cowan a écrit :
> On Thu, Apr 3, 2008 at 1:43 PM, John Rose <John.R...@sun.com> wrote:

>> Even better (if applicable) would be to have fast thread-local counters,
>> with a slow background phase which occasionally tallies them into a trailing
>> global counter.

> That reminds me of an old question of mine.  In the case where a
> thread has been created from an object whose class is a subclass of
> Thread, is Thread.currentThread() guaranteed to give you back the same
> object?  IOW, if I say:

> class MyThread extends Thread { ... }
> myThread = new MyThread();
> myThread.start();
> ...

> then in the new thread, is Thread.currentThread() always == to the
> original value of myThread?
yes
>  If so, that provides a different approach
> to thread-local state, where the state is held in the instance
> variables of MyThread objects,

yes, ThreadLocal is currently implemented has a field of  
java.lang.Thread storing a map,
so there is no synchronization.
>  and the JVM is used to thread them
> through :-) the code until the point where they're needed.

cheers,
Rémi

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google