RFR (S): 8151322: Implement os::set_native_thread_name() on Solaris
Gerard Ziemski
gerard.ziemski at oracle.com
Tue Mar 15 14:14:32 UTC 2016
Thanks for fixing this.
I do have one concern:
#1 File src/os/solaris/vm/os_solaris.cpp
4425 // retrieve entry point for pthread_setname_np
4426 Solaris::_pthread_setname_np =
4427 (int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np”);
According to “man dlsym” RTLD_DEFAULT can be expensive, i.e.:
"If dlsym() is called with the special handle RTLD_DEFAULT, then all mach-o images in the process (except those loaded with dlopen(xxx,
RTLD_LOCAL)) are searched in the order they were loaded. This can be a costly search and should be avoided."
Couldn’t we look it up on as needed basis in the implementation of "void os::set_native_thread_name(const char *name)” instead?
cheers
> On Mar 15, 2016, at 1:24 AM, David Holmes <david.holmes at oracle.com> wrote:
>
> RFE: https://bugs.openjdk.java.net/browse/JDK-8151322
>
> Webrev: http://cr.openjdk.java.net/~dholmes/8151322/webrev/
>
> As of Solaris 11.3 pthread_set_name_np has been implemented:
>
> http://docs.oracle.com/cd/E53394_01/html/E54766/pthread-setname-np-3c.html#scrolltoc
>
> https://blogs.oracle.com/observatory/entry/named_threads
>
> So we can now implement os::set_native_thread_name using dynamic lookup as done on Linux. The only difference is we have 31 characters to play with instead of 16.
>
> Testing: - JPRT (only 11.2 systems)
> - Manually on 11.3 - see examples in bug report
>
> Thanks,
> David
More information about the hotspot-runtime-dev
mailing list