zap icon indicating copy to clipboard operation
zap copied to clipboard

Any ideas about cancellation?

Open Subuday opened this issue 1 year ago • 4 comments

As far as I understand, task structure should have some sort of is_canceled variable? And there should check before calling callback. What is your vision on cancelling process?

Subuday avatar Jun 05 '24 06:06 Subuday

Given task memory is intrusively provided, if it never invokes the callback due to a cancellation request then how can it free the Task? Furthermore, not all tasks are inherently cancellable (especially ones that must do so asynchronously or are blocking). I think users should implement their own cancellation if they need it. Would recommend a CancellationToken pattern if so.

kprotty avatar Jun 10 '24 11:06 kprotty

Thanks.

Subuday avatar Jun 12 '24 20:06 Subuday

Could you recommend some materials, blogs, etc about intrusively memory? I've never seen/used this...

Subuday avatar Jun 12 '24 20:06 Subuday

I mean only from got about this thing only from your post =) By the way, incredible work. Amazing deep dive in thread pool

Subuday avatar Jun 12 '24 20:06 Subuday