[Lldb-commits] [PATCH] Implements a HostThread class.
Zachary Turner
zturner at google.com
Thu Aug 28 19:44:37 PDT 2014
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.
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.
On Thu, Aug 28, 2014 at 4:40 PM, <jingham at apple.com> wrote:
> 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.
>
> And you probably never would want to suspend & resume your own threads,
> that would be a very confusing way to program...
>
> Jim
>
>
> > On Aug 28, 2014, at 3:49 PM, David Majnemer <david.majnemer at gmail.com>
> wrote:
> >
> > 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.
> >
> > http://reviews.llvm.org/D5110
> >
> >
> >
> > _______________________________________________
> > lldb-commits mailing list
> > lldb-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140828/b57b6eeb/attachment.html>
More information about the lldb-commits
mailing list