Lines Matching defs:thread

103 WorkerAction SCPUWorkerManager::WorkerIdleAction(const WorkerThread* thread)
109 auto& ctl = sleepCtl[thread->GetQos()];
111 (void)monitor->IntoSleep(thread->GetQos());
112 FFRT_PERF_WORKER_IDLE(static_cast<int>(thread->GetQos()));
116 if (ctl.cv.wait_for(lk, std::chrono::seconds(waiting_seconds), [this, thread] {
117 bool taskExistence = GetTaskCount(thread->GetQos()) ||
118 reinterpret_cast<const CPUWorker*>(thread)->priority_task ||
119 reinterpret_cast<const CPUWorker*>(thread)->localFifo.GetLength();
120 bool needPoll = !FFRTFacade::GetPPInstance().GetPoller(thread->GetQos()).DetermineEmptyMap() &&
121 (polling_[thread->GetQos()] == 0);
124 monitor->WakeupCount(thread->GetQos());
125 FFRT_PERF_WORKER_AWAKE(static_cast<int>(thread->GetQos()));
132 monitor->IntoDeepSleep(thread->GetQos());
137 ctl.cv.wait(lk, [this, thread] {
138 return tearDown || GetTaskCount(thread->GetQos()) ||
139 reinterpret_cast<const CPUWorker*>(thread)->priority_task ||
140 reinterpret_cast<const CPUWorker*>(thread)->localFifo.GetLength();
142 monitor->OutOfDeepSleep(thread->GetQos());
145 monitor->TimeoutCount(thread->GetQos());
153 CPUEUTask* SCPUWorkerManager::PickUpTaskFromGlobalQueue(WorkerThread* thread)
159 auto& sched = FFRTScheduler::Instance()->GetScheduler(thread->GetQos());
160 auto lock = GetSleepCtl(static_cast<int>(thread->GetQos()));
165 CPUEUTask* SCPUWorkerManager::PickUpTaskBatch(WorkerThread* thread)
171 auto& sched = FFRTScheduler::Instance()->GetScheduler(thread->GetQos());
172 auto lock = GetSleepCtl(static_cast<int>(thread->GetQos()));
179 int wakedWorkerNum = monitor->WakedWorkerNum(thread->GetQos());
186 SpmcQueue* queue = &(reinterpret_cast<CPUWorker*>(thread)->localFifo);
187 int expectedTask = GetTaskCount(thread->GetQos()) / wakedWorkerNum - 1;
204 void SCPUWorkerManager::WorkerPrepare(WorkerThread* thread)
206 WorkerJoinTg(thread->GetQos(), thread->Id());
233 [pIns] (WorkerThread* thread) { return pIns->PickUpTaskFromGlobalQueue(thread); },
234 [pIns] (const WorkerThread* thread) { pIns->NotifyTaskPicked(thread); },
235 [pIns] (const WorkerThread* thread) { return pIns->WorkerIdleAction(thread); },
236 [pIns] (WorkerThread* thread) { pIns->WorkerRetired(thread); },
237 [pIns] (WorkerThread* thread) { pIns->WorkerPrepare(thread); },
238 [pIns] (const WorkerThread* thread, int timeout) { return pIns->TryPoll(thread, timeout); },
239 [pIns] (WorkerThread* thread) { return pIns->StealTaskBatch(thread); },
240 [pIns] (WorkerThread* thread) { return pIns->PickUpTaskBatch(thread); },
242 [pIns] (const WorkerThread* thread) { return pIns->IsExceedRunningThreshold(thread); },