Skip to main content
Code Review

Timeline for Pipeline with std::thread vectors and queue

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
May 23, 2017 at 11:33 history edited Community Bot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
May 9, 2016 at 15:30 comment added Edward Oh, I hadn't noticed. Good first question, and welcome to Code Review!
May 9, 2016 at 15:19 comment added CIVI89 Thanks, I would do it but unfortunately I've not enough reputation to up vote.
May 9, 2016 at 15:13 comment added Edward By the way, if you found the answer useful, you can upvote it as well as selecting it.
May 9, 2016 at 15:12 comment added Edward Yes, this is a frequently used idiom for synchronizing multiple threads and in fact, this is very much like one of the samples in the book C++ Concurrency in Action by Anthony Williams which is a book I'd highly recommend.
May 9, 2016 at 15:00 comment added CIVI89 Perfect! You think that in general this is a good way to implement a sort of multi-threaded pipeline? This should be a model that represent encoding algorithm like x264 (A LOT simplified) that instead use thread pools for each stage. But I've tried and synchronizing different thread pools is a real nightmare, so I've decided to use queues.
May 9, 2016 at 14:53 history edited Edward CC BY-SA 3.0
added lock_guard code
May 9, 2016 at 14:53 comment added Edward Definitely not thread safe! I've updated my answer to address this.
May 9, 2016 at 14:43 comment added CIVI89 Thanks for your useful advices, yes I intended the encoded vector, but remains one problem, it gives me now seg fault on the cout of the encoded vector, I think that maybe the concurrent push_back is not thread safe?
May 9, 2016 at 14:28 vote accept CIVI89
May 9, 2016 at 14:22 history answered Edward CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /