[{"id":2414,"web_url":"https://patchwork.libcamera.org/comment/2414/","msgid":"<20190815095901.x7ersmv427tskrv2@uno.localdomain>","date":"2019-08-15T09:59:01","subject":"Re: [libcamera-devel] [PATCH 00/18] Object & Thread enhancements","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nI had only few minor comments and some naive questions on the series,\nso please feel free to attach my R-b tag to all patches here, if\nrelevant.\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\nOn Mon, Aug 12, 2019 at 03:46:24PM +0300, Laurent Pinchart wrote:\n> Hello everybody,\n>\n> This patch series extends the Object and Thread implementations in\n> libcamera to improve thread affinity handling.\n>\n> This first patch is a simple cleanup.\n>\n> Object instances are associated with a thread, and the thread affinity\n> can be changed with Object::moveToThread(). This moves pending messages\n> for the object to the message queue of the new thread. Patch 02/18 fixes\n> a bug in the implementation that forgot to wake up the event loop of the\n> new thread, and patch 03/18 fixes a bug that prevented dispatching\n> message to the main thread.\n>\n> The next three patches split the slot-related classes from signal.h\n> (04/18), decouple them from the signal implementation (05/18) and use\n> them to add a new asynchronous method invocation mechanism for the\n> Object class (06/18). Patch 07/18 then adds a message to notify Object\n> instances of thread move. The next two patches are new tests for those\n> APIs.\n>\n> Patches 10/18 to 12/18 bind CameraManager, EventNotifier and Timer\n> instances to threads by inheriting from the Object class. The\n> EventNotifier and Timer classes now support being moved to a different\n> thread with proper operation with the new thread's event loop. The next\n> two patches add new tests for those operations.\n>\n> Patch 15/18 adds a parent-child hierarchy in the Object class, to\n> simplify moving objects to threads. Patch 16/18 supports this by adding\n> a parent argument to the constructor of various classes. Patch 17/18\n> extends the object test to cover the parent-child relationships, and\n> patch 18/18 shows how they can simplify code.\n>\n> Laurent Pinchart (18):\n>   libcamera: object: Make message() method protected\n>   libcamera: thread: Wake up target thread when moving objects\n>   libcamera: thread: Support dispatching messages to main thread\n>   libcamera: signal: Split Slot implementation to reusable classes\n>   libcamera: bound_method: Decouple from Signal implementation\n>   libcamera: object: Add an asynchronous method invocation method\n>   libcamera: object: Notify objects of thread move\n>   test: Add Object::invokeMethod() test\n>   test: Add Object class thread affinity test\n>   libcamera: camera_manager: Bind CameraManager to threads\n>   libcamera: event_notifier: Bind event notifiers to threads\n>   libcamera: timer: Bind timers to threads\n>   test: Add EventNotifier thread move test\n>   test: Add Timer thread move test\n>   libcamera: object: Create parent-child relationships\n>   libcamera: Add parent argument to constructors of Object-derived\n>     classes\n>   test: object: Extend object test to verify parent-child relationships\n>   test: Simplify tests with parent-child relationships\n>\n>  Documentation/Doxyfile.in               |  10 +-\n>  include/libcamera/bound_method.h        | 130 +++++++++++++++++++\n>  include/libcamera/camera_manager.h      |   4 +-\n>  include/libcamera/event_notifier.h      |  10 +-\n>  include/libcamera/meson.build           |   1 +\n>  include/libcamera/object.h              |  32 ++++-\n>  include/libcamera/signal.h              | 151 +++-------------------\n>  include/libcamera/timer.h               |  13 +-\n>  src/libcamera/bound_method.cpp          |  27 ++++\n>  src/libcamera/camera_manager.cpp        |   4 +-\n>  src/libcamera/event_dispatcher_poll.cpp |   3 +\n>  src/libcamera/event_notifier.cpp        |  22 +++-\n>  src/libcamera/include/message.h         |  22 ++--\n>  src/libcamera/include/thread.h          |   5 +-\n>  src/libcamera/meson.build               |   1 +\n>  src/libcamera/message.cpp               |  50 ++++++--\n>  src/libcamera/object.cpp                | 120 +++++++++++++++---\n>  src/libcamera/signal.cpp                |  23 ----\n>  src/libcamera/thread.cpp                |  26 +++-\n>  src/libcamera/timer.cpp                 |  33 ++++-\n>  test/event-thread.cpp                   | 106 ++++++++++++++++\n>  test/meson.build                        |   4 +\n>  test/object-invoke.cpp                  | 137 ++++++++++++++++++++\n>  test/object.cpp                         | 158 ++++++++++++++++++++++++\n>  test/timer-thread.cpp                   |  72 +++++++++++\n>  25 files changed, 948 insertions(+), 216 deletions(-)\n>  create mode 100644 include/libcamera/bound_method.h\n>  create mode 100644 src/libcamera/bound_method.cpp\n>  create mode 100644 test/event-thread.cpp\n>  create mode 100644 test/object-invoke.cpp\n>  create mode 100644 test/object.cpp\n>  create mode 100644 test/timer-thread.cpp\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2324B60E2C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2019 11:57:35 +0200 (CEST)","from uno.localdomain\n\t(host64-130-dynamic.5-87-r.retail.telecomitalia.it [87.5.130.64])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 75DFB1C0004;\n\tThu, 15 Aug 2019 09:57:34 +0000 (UTC)"],"X-Originating-IP":"87.5.130.64","Date":"Thu, 15 Aug 2019 11:59:01 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190815095901.x7ersmv427tskrv2@uno.localdomain>","References":"<20190812124642.24287-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"erdid5svn5pnzmle\"","Content-Disposition":"inline","In-Reply-To":"<20190812124642.24287-1-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 00/18] Object & Thread enhancements","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Thu, 15 Aug 2019 09:57:35 -0000"}}]