Skip to content

Commit

Permalink
Merge pull request #318 from anarkiwi/full
Browse files Browse the repository at this point in the history
discard serial number update if discarding inference request
  • Loading branch information
anarkiwi authored Sep 15, 2024
2 parents 77c2e6b + 036c770 commit 180682f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/image_inference_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class image_inference_impl : public image_inference, base_impl {
boost::scoped_ptr<std::thread> inference_thread_;
boost::scoped_ptr<torchserve_client> torchserve_client_;
boost::lockfree::spsc_queue<output_item_type> inference_q_{MAX_INFERENCE};
boost::lockfree::spsc_queue<std::string> json_q_{MAX_INFERENCE};
boost::lockfree::spsc_queue<std::string> json_q_{MAX_INFERENCE * 2};
boost::scoped_ptr<cv::Mat> cmapped_buffer_, resized_buffer_,
normalized_buffer_;

Expand Down
1 change: 1 addition & 0 deletions lib/iq_inference_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ void iq_inference_impl::process_items_(COUNT_T power_in_count,
if (background_) {
if (!inference_q_.push(output_item)) {
delete_output_item_(output_item);
--serial_;
if (host_now_() - last_full_time_ > 5) {
d_logger->error(
"inference queue full (increase inference dB threshold "
Expand Down
2 changes: 1 addition & 1 deletion lib/iq_inference_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class iq_inference_impl : public iq_inference, base_impl {
boost::lockfree::capacity<MAX_INFERENCE>>
inference_q_;
boost::lockfree::queue<std::string *,
boost::lockfree::capacity<MAX_INFERENCE>>
boost::lockfree::capacity<MAX_INFERENCE * 2>>
json_q_;
boost::shared_ptr<boost::asio::io_service> io_service_;
boost::shared_ptr<boost::asio::io_service::work> work_;
Expand Down

0 comments on commit 180682f

Please sign in to comment.