Skip to content

Commit

Permalink
Review feedback: Add note in ModelInstanceInitialize that it may be c…
Browse files Browse the repository at this point in the history
…alled concurrently and should be thread-safe
  • Loading branch information
rmccorm4 committed Aug 4, 2023
1 parent 324fefd commit c7b7e9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/onnxruntime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,10 @@ TRITONBACKEND_ModelFinalize(TRITONBACKEND_Model* model)
TRITONBACKEND_ISPEC TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceInitialize(TRITONBACKEND_ModelInstance* instance)
{
// NOTE: If the corresponding TRITONBACKEND_BackendAttribute is enabled by the
// backend for parallel model instance loading, the
// TRITONBACKEND_ModelInstanceInitialize may be called concurrently.
// Therefore, this function should be thread-safe.
const char* cname;
RETURN_IF_ERROR(TRITONBACKEND_ModelInstanceName(instance, &cname));
std::string name(cname);
Expand Down

0 comments on commit c7b7e9f

Please sign in to comment.