Skip to content

Commit 1acb956

Browse files
committed
[comment] Clarify why PbTensor::LoadFromSharedMemory() requires holding GIL
1 parent 47e71e0 commit 1acb956

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/infer_response.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ InferResponse::LoadFromSharedMemory(
169169
response_shm.data_.get() + sizeof(ResponseShm));
170170
{
171171
#ifdef TRITON_PB_STUB
172-
// Need to acquire the GIL to avoid hangs.
172+
// PbTensor::LoadFromSharedMemory() will construct Python objects if
173+
// called from pb_stub, which requires holding the GIL.
173174
py::gil_scoped_acquire acquire;
174175
#endif
175176
for (size_t idx = 0; idx < requested_output_count; ++idx) {

0 commit comments

Comments
 (0)