Thread.getId() just returns a field value.

On 1 March 2016 at 16:04, Gary Gregory <[email protected]> wrote:

> YW. I might not be able to get back to this until tonight or tomorrow so
> feel free to tweak.
>
> Gary
> On Mar 1, 2016 1:53 PM, "Remko Popma" <[email protected]> wrote:
>
>> Gary, thanks for doing the work on this!
>>
>> There's no need to cache the thread ID or priority in the
>> ThreadNameCachingStrategy, we can just ask the Thread.currentThread().
>>
>> The reason the thread name is cached is that Thread.getName() is
>> implemented as a JNI method returning a char[] array, which is then wrapped
>> in a new String. There's significant overhead with that. Obtaining an
>> int/long should not have that drawback.
>>
>> (Although I haven't checked the implementation on Thread, I hope they're
>> not expensive JNI methods, that would change things...)
>>
>> Directly calling the relevant methods on Thread also means we don't need
>> to autobox the values which is nice.
>>
>> Sent from my iPhone
>>
>> > On 2016/03/02, at 3:43, [email protected] wrote:
>> >
>> > ThreadNameCachingStrategy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>


-- 
Matt Sicker <[email protected]>

Reply via email to