szaszm commented on a change in pull request #735: MINIFICPP-1158 - Event 
driven processors can starve each other
URL: https://github.com/apache/nifi-minifi-cpp/pull/735#discussion_r382710596
 
 

 ##########
 File path: libminifi/include/FlowController.h
 ##########
 @@ -380,6 +356,8 @@ class FlowController : public 
core::controller::ControllerServiceProvider, publi
 
   std::shared_ptr<core::ContentRepository> content_repo_;
 
+  // Thread pool for schedulers
+  std::shared_ptr<utils::ThreadPool<utils::ComplexTaskResult>> thread_pool_;
 
 Review comment:
   We could make the lifetime and ownership of `thread_pool_` clearer by making 
`FlowController` the owner and all the `SchedulingAgent`s only have a 
non-owning reference (or non-null pointer). I think we can even manage without 
extra heap allocation by making it a data member (non-ptr) and 
`stop()`/`operator=`/`start()`ing it `onSchedule()`, thus making pointers 
stable and `shared_ptr` unnecessary over raw observer ptrs.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to