public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Michael Weghorn <m.weghorn@posteo.de>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v5 1/2] gdbsupport: allow to specify dependencies between observers
Date: Mon, 26 Apr 2021 19:56:01 +0000	[thread overview]
Message-ID: <8f7047ef-372f-36de-b87a-03fceb198bb7@posteo.de> (raw)
In-Reply-To: <20210426145340.493597-2-simon.marchi@polymtl.ca>


[-- Attachment #1.1: Type: text/plain, Size: 1521 bytes --]

On 26/04/2021 16.53, Simon Marchi wrote:
> From: Michael Weghorn <m.weghorn@posteo.de>
> 
> Previously, the observers attached to an observable were always notified
> in the order in which they had been attached.  That order is not easily
> controlled, because observers are typically attached in _initialize_*
> functions, we are called in an undefined order.

Just a nit-pick, should that read "functions, WHICH are called in an 
undefined order."?

> 
> However, an observer may require that another observer attached only
> later is called before itself is.
> 
> Therefore, extend the 'observable' class to allow explicitly specifying
> dependencies when attaching observers, by adding the possibility to
> specify tokens for observers that it depends on.
> 
> To make sure dependencies are notified before observers depending on
> them, the vector holding the observers is sorted in a way that
> dependencies come before observers depending on them.  The current
> implementation for sorting uses the depth-first search algorithm for
> topological sorting as described at [1].
> 
> Extend the observable unit tests to cover this case as well.  Check that
> this works for a few different orders in which the observers are
> attached.
> 
> This newly introduced mechanism to explicitly specify dependencies will
> be used in a follow-up commit.
> 
> [1] https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search
> 
> Tested on x86_64-linux (Debian testing).

Michael


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2021-04-26 19:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 14:53 [PATCH v5 0/2] Make sure autoload happens before notifying Python side in new_objfile event Simon Marchi
2021-04-26 14:53 ` [PATCH v5 1/2] gdbsupport: allow to specify dependencies between observers Simon Marchi
2021-04-26 19:56   ` Michael Weghorn [this message]
2021-04-26 22:18     ` Simon Marchi
2021-04-27  8:30   ` Andrew Burgess
2021-04-27 13:34     ` Simon Marchi
2021-04-26 14:53 ` [PATCH v5 2/2] gdb: do autoload before notifying Python side in new_objfile event Simon Marchi
2021-04-26 19:56   ` Michael Weghorn
2021-04-26 20:44     ` Simon Marchi
2021-04-27  8:39   ` Andrew Burgess
2021-04-27 13:43     ` Simon Marchi
2021-04-27 13:53       ` Simon Marchi
2021-04-29 15:39     ` Vaseeharan Vinayagamoorthy
2021-04-29 19:41       ` Michael Weghorn
2021-04-29 19:47         ` Simon Marchi
2021-04-26 20:05 ` [PATCH v5 0/2] Make sure autoload happens " Michael Weghorn
2021-04-27 15:23   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f7047ef-372f-36de-b87a-03fceb198bb7@posteo.de \
    --to=m.weghorn@posteo.de \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).