dam4rus commented on pull request #992:
URL: https://github.com/apache/nifi-minifi-cpp/pull/992#issuecomment-782216241


   I'm pretty sure that locking multiple times in a loop can [degrade 
performance](https://quick-bench.com/q/6Tb3pu8sUC80EtpJtxht7uxHlLE) 
significantly and [that's not what you 
want](https://www.techiedelight.com/why-vector-class-java-obsolete/#:~:text=This%20is%20because%20Vector%20synchronizes,synchronized%20and%20not%20individual%20operations.)
 most of the time. While `ConcurrentQueue::pop_all` and 
`ConcurrentQueue::push_all` can solve some cases but for more complex cases 
like `Connection::poll` it's kinda hard to write a generic solution. I can 
probably make it work somehow but I'm not sure that it would be easier to 
reason about that this solution.
   
   I've created this PR mainly as a PoC and I agree that a public API would be 
better than exposing the underlying queue. I don't mind if you guys would 
rather extend the ConcurrentQueue class or leave it as it is.


----------------------------------------------------------------
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]


Reply via email to