Skip to content

Canceller improvements#1516

Merged
johnhaddon merged 3 commits intoImageEngine:mainfrom
johnhaddon:cancellerImprovements
Feb 18, 2026
Merged

Canceller improvements#1516
johnhaddon merged 3 commits intoImageEngine:mainfrom
johnhaddon:cancellerImprovements

Conversation

@johnhaddon
Copy link
Member

This improves the Canceller class, in support of some upcoming cancellation improvements in Gaffer.

This will be useful in Gaffer, where there are a couple of spots where we must pass stack-allocated Cancellers to Python as raw pointers, and just hope that nobody accesses them after they expire. It also enables the next commit, where we allow cancellers to be chained.
This means that one canceller can automatically cancel others. It will be used in Gaffer, where multiple clients (each with their own canceller) may end up working on the same compute by virtue of task collaboration.

Although this adds a mutex and additional state, the hot-path that we care about (`check()`), is unchanged. The mutex is only used rarely, when adding/removing children and at the point of cancellation.
So that the public API fits easily onto a single screen, without being cluttered with implementation detail.
@johnhaddon johnhaddon force-pushed the cancellerImprovements branch from dc8a603 to 519cc90 Compare February 18, 2026 11:13
@danieldresser-ie
Copy link
Contributor

LGTM

@johnhaddon johnhaddon merged commit ee9b357 into ImageEngine:main Feb 18, 2026
6 checks passed
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.

2 participants

Comments