<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 18, 2016, at 8:41 PM, Bekket McClane <<a href="mailto:bekket.mcclane@gmail.com" class="">bekket.mcclane@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> 於 2016年10月19日 上午11:30 寫道:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 18, 2016, at 6:28 PM, Bekket McClane via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class="">The LLVM variant we're building now contains usage of a third-party threading library, and we would like to push our work upstream in the future. </div></div></div></blockquote><div class=""><br class=""></div><div class="">What is the motivation?</div><div class="">For instance what is this doing that std::thread or llvm::ThreadPool is not providing? Why is it useful to have it in tree?</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">The library we’re using is actually a routine library which provides extremely fast context switching similar to Go routine.</div></div></div></div></blockquote><div><br class=""></div><div>That’s interesting, but are you intending to use this as a runtime to go with the code *generated by LLVM* or are you planning to use this to implement the compiler internals?</div><div><br class=""></div><div>This is a significant difference, as in the first case we have started a “parallel libs” subproject here: <a href="http://llvm.org/svn/llvm-project/parallel-libs/trunk/" class="">http://llvm.org/svn/llvm-project/parallel-libs/trunk/</a></div><div>I’m not sure we would take an external lib, but we would consider integrating as a new LLVM subproject if there was a motivation on both side to get there.</div><div><br class=""></div><div>For the second case (using it in the compiler itself), what kind of uses do you have for this in your “LLVM variant”?</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">I think neither standard library nor LLVM support library provide this functionality.</div></div></div></div></blockquote><div><br class=""></div><div>We’re implementing C++ coroutine though: <a href="https://www.youtube.com/watch?v=8C8NnE1Dg4A" class="">https://www.youtube.com/watch?v=8C8NnE1Dg4A</a></div><div>(Not sure how it relates to what you’re doing, but since you mentioned coroutines…)</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Are third-party libraries welcomed to be added in LLVM? If yes, what folder structure should we arrange? </div></div></div></blockquote><div class=""><br class=""></div><div class="">In general we avoid them as much as possible and need a really compelling justification to include one.</div><div class="">Chris reinstated this position recently: <a href="http://lists.llvm.org/pipermail/llvm-dev/2016-September/105166.html" class="">http://lists.llvm.org/pipermail/llvm-dev/2016-September/105166.html</a></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Thanks, we would take this policy into our consideration.</div><div class=""><br class=""></div>B.R.</div><div class="">McClane<br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>