[RFA] Make continuations per-thread.

Pedro Alves pedro@codesourcery.com
Fri May 2 11:34:00 GMT 2008


A Friday 02 May 2008 04:00:12, Daniel Jacobowitz wrote:
> On Thu, Apr 24, 2008 at 07:45:38PM +0300, Vladimir Prus wrote:
> > Right now, continuations are global. This means that if we're doing
> > 'finish' in one thread, then we cannot do 'finish' or anything that
> > also uses continuations, in any other thread. This seems unnecessary
> > limitation, and this patch makes continuations per-thread.
> >
> > Further into non-stop series, it really allows me to do 'finish' or
> > 'step' in several threads independently.
> >
> > OK?
>
> Could you explain why this is safe?  We will do continuations for the
> thread which reports an event only.  So it seems like continuations
> for other threads will linger in their struct thread.
>
> For example, if we finish from one thread and hit a breakpoint in
> another thread before the finish returns.

That's true.  Attached is what we have next on the non-stop
series to fix that.  I'm not thrilled by it, but there are intermediate
context switches in handle_inferior_event that make it much uglier to try
to not make it centralized.  This is one of the things that gets much
better looking when we switch completelly to always-a-thread, and
get rid of context-switching.  I'm introducing another variable, instead of
using previous_inferior_ptid, which would be a good candidate, but I have
other plans for it.

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch_context_for_intermediate_continuations.patch
Type: text/x-diff
Size: 3689 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080502/0062c381/attachment.bin>


More information about the Gdb-patches mailing list