Skip to content

Commit e699a65

Browse files
authored
Merge 4e22bc4 into sapling-pr-archive-ktf
2 parents 8c3d096 + 4e22bc4 commit e699a65

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,8 @@ DataProcessingDevice::DataProcessingDevice(RunningDeviceRef running, ServiceRegi
212212
});
213213
}
214214

215-
// Callback to execute the processing. Notice how the data is
216-
// is a vector of DataProcessorContext so that we can index the correct
217-
// one with the thread id. For the moment we simply use the first one.
215+
// Callback to execute the processing. Receives and relays data (doPrepare)
216+
// happens on the main thread before this is queued, so we only dispatch here.
218217
void run_callback(uv_work_t* handle)
219218
{
220219
auto* task = (TaskStreamInfo*)handle->data;
@@ -223,7 +222,6 @@ void run_callback(uv_work_t* handle)
223222
auto& dataProcessorContext = ref.get<DataProcessorContext>();
224223
O2_SIGNPOST_ID_FROM_POINTER(sid, device, &dataProcessorContext);
225224
O2_SIGNPOST_START(device, sid, "run_callback", "Starting run callback on stream %d", task->id.index);
226-
DataProcessingDevice::doPrepare(ref);
227225
DataProcessingDevice::doRun(ref);
228226
O2_SIGNPOST_END(device, sid, "run_callback", "Done processing data for stream %d", task->id.index);
229227
}
@@ -1336,6 +1334,10 @@ void DataProcessingDevice::Run()
13361334
handleRegionCallbacks(mServiceRegistry, mPendingRegionInfos);
13371335
}
13381336

1337+
// Receive and relay incoming data on the main thread so that I/O
1338+
// overlaps with computation running concurrently on work threads.
1339+
DataProcessingDevice::doPrepare(ref);
1340+
13391341
assert(mStreams.size() == mHandles.size());
13401342
/// Decide which task to use
13411343
TaskStreamRef streamRef{-1};

0 commit comments

Comments
 (0)