<div dir="ltr">I'm defining HostThread as "a lightweight wrapper around your OS's native thread type (pthread_t on posix, HANDLE on windows)".  So yes, it *can* be used for threads of the lldb process itself, but it can also be used for threads of other processes running in the same os environment as the lldb process.  It doesn't represent a thread that's under the control of the debugger, although it's highly likely that whatever class did represent that would be backed by a HostThread.<div>
<br></div><div>e.g. lldb on machine A, llgs on machine B.  A is debugging some process P which is running on B.  A tells B "list all the threads of this process".  B is running in the same OS as the inferior, so B calls some function which enumerates HostThreads given a pid, and marshals them somehow, passing the results back to A.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 4:40 PM,  <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Suspending threads in the inferior is very useful.  There are some parts of the Host interface that will be used by the the Native* for that host, e.g. launching.  So there might be things in the Host interface that you wouldn't naively think were necessary.  IIUC however, HostThread operations refer to threads in the lldb process itself, and how you would suspend & resume your own threads and those of another process are likely to be quite different.  So I don't think we need them for that reason.<br>

<br>
And you probably never would want to suspend & resume your own threads, that would be a very confusing way to program...<br>
<span class="HOEnZb"><font color="#888888"><br>
Jim<br>
</font></span><div class="im HOEnZb"><br>
<br>
> On Aug 28, 2014, at 3:49 PM, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
><br>
> Suspend and Resume are a little questionable, why do we need them?  They can make reasoning about threads way more challenging and can almost always be replaced by an explicit synchronization mechanism.<br>
><br>
> <a href="http://reviews.llvm.org/D5110" target="_blank">http://reviews.llvm.org/D5110</a><br>
><br>
><br>
><br>
</div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
</div></div></blockquote></div><br></div>