This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Add optional argument to "info threads" command


On Monday 24 November 2008 19:05:12, Michael Snyder wrote:
> Well, all your observations are correct -- but the same thing
> also happens if you merely switch the thread of focus using the
> "thread" command.
> 
> I do think that prune-threads and target_find_new_threads
> are being called too aggressively from somewhere, but it
> isn't directly from info_threads_command.

It's inside print_thread_info, and IIUC, you're calling it
on each of the ids in range?

> I think this is a separate, pre-existing problem that this patch
> helps to reveal.

I'm thinking about the case where you have 200 threads, and you
do 'info threads 40-45'.

That'll do 15 prune_threads, target_find_new_threads and
frame restores.  That'll be around '14 * (200 + 200 + 1)'
roundtrips extra at least instead of the current (200 + 200).

The worst case, is of course, if you do 'info threads 1-200'.
Then you'll have '199 * (200 + 200 + 1)' extra target
roundtrips compared to plain 'info threads'.  That's around
80000?  Unless I'm missing something.

Isn't this the same reasoning behind having thread_apply_command
and thread_apply_all implementations, instead of having one call
into the other?

(Upps, just spotted a cleanups bug in thread_apply_command).

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]