Skip to content

Remove threadPool.clear and instead provide means of pausing the threadPool#3321

Open
IntegratedQuantum wants to merge 1 commit into
PixelGuys:masterfrom
IntegratedQuantum:threadPool_unclear
Open

Remove threadPool.clear and instead provide means of pausing the threadPool#3321
IntegratedQuantum wants to merge 1 commit into
PixelGuys:masterfrom
IntegratedQuantum:threadPool_unclear

Conversation

@IntegratedQuantum

Copy link
Copy Markdown
Member

clear() is a brute-force solution, and it doesn't behave predictably when multiple threads are involved, as discovered in #3278 (comment)

This is solved here by providing the ability to pause the threadpool momentarily (e.g. during cleanup). This means we do not have to worry about other tasks interfering with our cleanup logic
Then the cleanup phase can manually unschedule the tasks it doesn't need anymore (relying on the isStillNeeded function, which can be triggered by task reprioritization).

fixes #3237
helps with #3278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit use-cases of threadPool.clear()

1 participant