Deferred deletion of allocations in main thread

Add a clearQueueTillFirstFailure interface to DeferredDeleter, which
iterates the queue from the front and delete the allocations in the
queue till a failure. It is called by defer deletion of allocations
occupied by mutliple contexts to unlock the execution in main thread

Related-To: NEO-7532

Signed-off-by: HeFan2017 <fan.f.he@intel.com>
This commit is contained in:
HeFan2017
2022-12-12 10:57:02 +00:00
committed by Compute-Runtime-Automation
parent a572f6ce95
commit c268e30189
13 changed files with 159 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -31,11 +31,13 @@ class DeferredDeleter {
MOCKABLE_VIRTUAL void drain(bool blocking);
MOCKABLE_VIRTUAL void clearQueueTillFirstFailure();
protected:
void stop();
void safeStop();
void ensureThread();
MOCKABLE_VIRTUAL void clearQueue();
MOCKABLE_VIRTUAL void clearQueue(bool breakOnFailure);
MOCKABLE_VIRTUAL bool areElementsReleased();
MOCKABLE_VIRTUAL bool shouldStop();