{"id":1778,"url":"https://patchwork.libcamera.org/api/1.1/covers/1778/?format=json","web_url":"https://patchwork.libcamera.org/cover/1778/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190812124642.24287-1-laurent.pinchart@ideasonboard.com>","date":"2019-08-12T12:46:24","name":"[libcamera-devel,00/18] Object & Thread enhancements","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/1778/mbox/","series":[{"id":455,"url":"https://patchwork.libcamera.org/api/1.1/series/455/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=455","date":"2019-08-12T12:46:24","name":"Object & Thread enhancements","version":1,"mbox":"https://patchwork.libcamera.org/series/455/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/1778/comments/","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE36560E38\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Aug 2019 14:46:48 +0200 (CEST)","from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B3F6327\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Aug 2019 14:46:48 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1565614008;\n\tbh=XIA9IytBAHbQT12qkXQG/uIwm8noBuG9VaYc5NCjocs=;\n\th=From:To:Subject:Date:From;\n\tb=uNEABFropwg1MN40Jt9BDhcUQGB/pMv/ru8EYSW4uPYt/GqWgVT0sya2eKG77B5CP\n\tl1iejxj37warJvZZNAdg4k5uk7UzHmq1paNfrTTG+h3FaaD5JF2uHaXcImSGqxge2j\n\tjfSNPzBXIb5VYr4zUUEnpdbpZRoxLIp/mwe75P/w=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 12 Aug 2019 15:46:24 +0300","Message-Id":"<20190812124642.24287-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.21.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[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":"Mon, 12 Aug 2019 12:46:49 -0000"},"content":"Hello everybody,\n\nThis patch series extends the Object and Thread implementations in\nlibcamera to improve thread affinity handling.\n\nThis first patch is a simple cleanup.\n\nObject instances are associated with a thread, and the thread affinity\ncan be changed with Object::moveToThread(). This moves pending messages\nfor the object to the message queue of the new thread. Patch 02/18 fixes\na bug in the implementation that forgot to wake up the event loop of the\nnew thread, and patch 03/18 fixes a bug that prevented dispatching\nmessage to the main thread.\n\nThe next three patches split the slot-related classes from signal.h\n(04/18), decouple them from the signal implementation (05/18) and use\nthem to add a new asynchronous method invocation mechanism for the\nObject class (06/18). Patch 07/18 then adds a message to notify Object\ninstances of thread move. The next two patches are new tests for those\nAPIs.\n\nPatches 10/18 to 12/18 bind CameraManager, EventNotifier and Timer\ninstances to threads by inheriting from the Object class. The\nEventNotifier and Timer classes now support being moved to a different\nthread with proper operation with the new thread's event loop. The next\ntwo patches add new tests for those operations.\n\nPatch 15/18 adds a parent-child hierarchy in the Object class, to\nsimplify moving objects to threads. Patch 16/18 supports this by adding\na parent argument to the constructor of various classes. Patch 17/18\nextends the object test to cover the parent-child relationships, and\npatch 18/18 shows how they can simplify code.\n\nLaurent 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"}