pplx task cancellation on linux
I tried to execute the cancelling parallel tasks exemple on linux but it didn't work (the task was never canceled).
Here is the output: Creating task... Performing work... Performing work... Performing work... Performing work... Canceling task... Waiting for task to complete... Performing work... Performing work... Performing work... Performing work... Performing work... ...
This sounds like a bug. I'll mark it for investigation.
This is a known issue with pplx when not interoperating with the MS concurrency libraries (i.e., if CPPREST_FORCE_PPLX is defined). The call to is_task_cancellation_requested() always returns false (and is documented as such in the code).
The workaround is to instead capture the cancellation token into your lambda expression, and check token.is_canceled() to decide whether or not to cancel the task.