<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 6, 2017 at 2:43 PM, Maciej Stachowiak <span dir="ltr">&lt;<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On Jan 5, 2017, at 8:07 PM, Yusuke SUZUKI &lt;<a href="mailto:utatane.tea@gmail.com" target="_blank">utatane.tea@gmail.com</a>&gt; wrote:</div><br class="m_118899531110008129Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 6, 2017 at 10:37 AM, Maciej Stachowiak<span class="m_118899531110008129Apple-converted-space"> </span><span dir="ltr">&lt;<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>&gt;</span><span class="m_118899531110008129Apple-converted-space"> </span>wro<wbr>te:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class="m_118899531110008129gmail-"><blockquote type="cite"><div>On Jan 5, 2017, at 9:37 AM, Brady Eidson &lt;<a href="mailto:beidson@apple.com" target="_blank">beidson@apple.com</a>&gt; wrote:</div><br class="m_118899531110008129gmail-m_-8698724453431853117Apple-interchange-newline"><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jan 5, 2017, at 12:48 AM, Yusuke SUZUKI &lt;<a href="mailto:utatane.tea@gmail.com" target="_blank">utatane.tea@gmail.com</a>&gt; wrote:</div><br class="m_118899531110008129gmail-m_-8698724453431853117Apple-interchange-newline"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 5, 2017 at 5:43 PM, Darin Adler<span class="m_118899531110008129Apple-converted-space"> </span><span dir="ltr">&lt;<a href="mailto:darin@apple.com" target="_blank">darin@apple.com</a>&gt;</span><span class="m_118899531110008129Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I understand the appeal of “org.webkit” and structured names but personally I would prefer to read names that look like titles and are made up of words with spaces, like these:<br><br>“WebKit: Image Decoder”, rather than “org.webkit.ImageDecoder”.<br>“WebKit: JavaScript DFG Compiler” rather than “org.webkit.jsc.DFGCompiler”.<br><br>Not sure how well that would generalize to all the different names.<br><br>I like the idea of having a smart way of automatically making a shorter name for the platforms that have shorter length limits.<br></blockquote><div><br></div><div>One interesting idea I&#39;ve come up with is that,</div><div><br></div><div>1. specifying &quot;org.webkit.ImageDecoder&quot;</div><div>2. In Linux, we just use &quot;ImageDecoder&quot; part.</div><div>3. In macOS port, we automatically convert it to &quot;WebKit: Image Decoder”</div></div></div></div></div></blockquote><div><br></div><div><div>Why do we specify “org.webkit.ImageDecoder” if only the “ImageDecoder” part is ever going to be used?</div></div><div>Is that because Windows could use “org.webkit.”?</div></div></div></div></blockquote><div><br></div></span><div>What about if you just specify &quot;Image Decoder&quot; and we automatically convert that to either &quot;ImageDecoder&quot; or &quot;WebKit: Image Decoder&quot; based on platform thread name limits? Is there any case where we want a prefix other than &quot;WebKit: &quot;?</div></div></div></blockquote><div><br></div><div>Yeah. For the prefix case, automatically adding &quot;WebKit: &quot; is fine. The current ToT has the name like &quot;<span style="font-size:12.8px">com.apple.IPC.ReceiveQueue&quot;.</span></div><div><span style="font-size:12.8px">Previously I thought that we may need to convert it to &quot;Apple WebKit:&quot; or something like that.</span></div><div><span style="font-size:12.8px">But now, I think simply using &quot;WebKit: IPC Receive Queue&quot; is fine.</span></div><div><br></div><div>But I think automatically changing &quot;ImageDecoder&quot; to &quot;Image Decoder&quot; does not work well with long names.</div><div>There is a name like &quot;AsynchrnousDisassembler&quot;. It is &gt;= 15 characters. &quot;AsynchronousDisas&quot; is not good for Linux.</div><div>On the other hand, using &quot;AsyncDisasm&quot; =&gt; &quot;WebKit: AsyncDisasm&quot; is not good for macOS.</div><div>For macOS, we can choose more readable name like &quot;WebKIt: Asynchronous Disassembler&quot;.</div><div><br></div><div>So, I think Geoffrey&#39;s suggestion works well: using long / short name pairs. Like,</div><div><br></div><div>ThreadName { &quot;Asynchronous Disassembler&quot;, &quot;AsyncDisasm&quot; } // { const char*, const char* }</div><div><br></div><div>// OR, </div><div>CREATE_THREAD_NAME(&quot;<wbr>Asynchronous Disassembler&quot;, &quot;AsyncDisasm&quot;) macro =&gt; generating ThreadName(&quot;WebKit: Asynchronous Disassembler&quot;) on macOS, ThreadName(&quot;AsyncDisasm&quot;) on Linux</div></div></div></div></div></blockquote><br></div></div></div><div>If there&#39;s a good set of &quot;short name&quot; and &quot;long name&quot; length limits, it would be cool if we could check the length at compile time, which seems more feasible with the macro.</div><div><br></div></div></blockquote><div><br></div><div>Yeah! That&#39;s what I would like to do. The typical ThreadName implementation would become the following.</div><div><br></div><div>class ThreadName {</div><div>public:</div><div>    template&lt;unsigned N&gt;</div><div>    explicit ThreadName(const char (&amp;name)[N])</div><div>        : m_name(name)</div><div>    {</div><div>#if OS(LINUX)</div><div>        static_assert(N &lt;= 16, &quot;&quot;);</div><div>#else if OS(WINDOWS)</div><div>        static_assert(N &lt;= 32, &quot;&quot;);</div><div>#endif</div><div>    }</div><div><br></div><div>    operator const char*()</div><div>    {</div><div>        return m_name;</div><div>    }</div><div><br></div><div>private:</div><div>    const char* m_name;</div><div>};</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>Regards,</div><div>Maciej</div><div><br></div></div></blockquote></div><br></div></div>