RESOLVED FIXED 186836
[GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
https://bugs.webkit.org/show_bug.cgi?id=186836
Summary [GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
Yusuke Suzuki
Reported 2018-06-20 00:56:48 PDT
[GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
Attachments
Patch (4.78 KB, patch)
2018-06-20 00:57 PDT, Yusuke Suzuki
no flags
Patch (6.00 KB, patch)
2018-06-20 00:59 PDT, Yusuke Suzuki
cgarcia: review+
Yusuke Suzuki
Comment 1 2018-06-20 00:57:50 PDT
Yusuke Suzuki
Comment 2 2018-06-20 00:59:51 PDT
Carlos Garcia Campos
Comment 3 2018-06-20 01:22:31 PDT
Comment on attachment 343139 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343139&action=review > Source/WTF/wtf/WorkerPool.h:66 > + const char* m_name; This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no?
Yusuke Suzuki
Comment 4 2018-06-20 01:27:20 PDT
Comment on attachment 343139 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343139&action=review >> Source/WTF/wtf/WorkerPool.h:66 >> + const char* m_name; > > This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? Is there the use case of the non-static string for WorkerPool name? I think ASCIILiteral would be nice, but I'm not sure CString is necessary.
Carlos Garcia Campos
Comment 5 2018-06-20 01:31:05 PDT
(In reply to Yusuke Suzuki from comment #4) > Comment on attachment 343139 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=343139&action=review > > >> Source/WTF/wtf/WorkerPool.h:66 > >> + const char* m_name; > > > > This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? > > Is there the use case of the non-static string for WorkerPool name? I think > ASCIILiteral would be nice, but I'm not sure CString is necessary. I don't know, if you are sure a static string is always going to be used, I'm fine.
Yusuke Suzuki
Comment 6 2018-06-20 01:36:08 PDT
Comment on attachment 343139 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343139&action=review >>>> Source/WTF/wtf/WorkerPool.h:66 >>>> + const char* m_name; >>> >>> This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? >> >> Is there the use case of the non-static string for WorkerPool name? I think ASCIILiteral would be nice, but I'm not sure CString is necessary. > > I don't know, if you are sure a static string is always going to be used, I'm fine. I would like to keep thread names as static if we do not have strong use cases, because static thread names are easy to grep, and the code shows clear intention (this thread is for "XXX") :)
Carlos Garcia Campos
Comment 7 2018-06-20 01:48:43 PDT
(In reply to Yusuke Suzuki from comment #6) > Comment on attachment 343139 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=343139&action=review > > >>>> Source/WTF/wtf/WorkerPool.h:66 > >>>> + const char* m_name; > >>> > >>> This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? > >> > >> Is there the use case of the non-static string for WorkerPool name? I think ASCIILiteral would be nice, but I'm not sure CString is necessary. > > > > I don't know, if you are sure a static string is always going to be used, I'm fine. > > I would like to keep thread names as static if we do not have strong use > cases, because static thread names are easy to grep, and the code shows > clear intention (this thread is for "XXX") :) Ok, is there a way to enforce it?
Carlos Garcia Campos
Comment 8 2018-06-20 01:48:51 PDT
Comment on attachment 343139 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343139&action=review >>>>>> Source/WTF/wtf/WorkerPool.h:66 >>>>>> + const char* m_name; >>>>> >>>>> This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? >>>> >>>> Is there the use case of the non-static string for WorkerPool name? I think ASCIILiteral would be nice, but I'm not sure CString is necessary. >>> >>> I don't know, if you are sure a static string is always going to be used, I'm fine. >> >> I would like to keep thread names as static if we do not have strong use cases, because static thread names are easy to grep, and the code shows clear intention (this thread is for "XXX") :) > > Ok, is there a way to enforce it? This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no?
Yusuke Suzuki
Comment 9 2018-06-20 01:53:24 PDT
Comment on attachment 343139 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343139&action=review >>>>>>> Source/WTF/wtf/WorkerPool.h:66 >>>>>>> + const char* m_name; >>>>>> >>>>>> This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? >>>>> >>>>> Is there the use case of the non-static string for WorkerPool name? I think ASCIILiteral would be nice, but I'm not sure CString is necessary. >>>> >>>> I don't know, if you are sure a static string is always going to be used, I'm fine. >>> >>> I would like to keep thread names as static if we do not have strong use cases, because static thread names are easy to grep, and the code shows clear intention (this thread is for "XXX") :) >> >> Ok, is there a way to enforce it? > > This is a problem if the passed name is not a static string. I think it would be safer to use a CString even if we have to duplicate it, no? Using ASCIILiteral can express that we require literal (ASCIILiteral("thread name")) since ASCIILiteral does not have implicit constructor from const char*. And I'm planning to add user-defined literal for ASCIILiteral and remove ASCIILiteral constructor. Then, we can enforce this! https://bugs.webkit.org/show_bug.cgi?id=186839
Yusuke Suzuki
Comment 10 2018-06-20 02:00:32 PDT
Radar WebKit Bug Importer
Comment 11 2018-06-20 02:01:25 PDT
Note You need to log in before you can comment on or make changes to this bug.