Skip to content

Commit

Permalink
Implement unique request IDs across threads
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkotila committed Dec 6, 2023
1 parent c8c5f14 commit 1890a34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/c++/perf_analyzer/infer_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ InferContext::SendRequest(

thread_stat_->num_sent_requests_++;
if (async_) {
infer_data_.options_->request_id_ = std::to_string(request_id);
uint64_t unique_request_id{(thread_id_ << 48) | ((request_id << 16) >> 16)};
infer_data_.options_->request_id_ = std::to_string(unique_request_id);
{
std::lock_guard<std::mutex> lock(thread_stat_->mu_);
auto it = async_req_map_
Expand Down

0 comments on commit 1890a34

Please sign in to comment.