Bug 2007 - Task Parallelism and conditional continuation - continuation tasks not cancelling when antecedent completes
Summary: Task Parallelism and conditional continuation - continuation tasks not cancel...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Jérémie Laval
URL:
Depends on:
Blocks:
 
Reported: 2011-11-11 09:11 UTC by Martin Stafford
Modified: 2012-04-11 11:26 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
ViewController class containing the code I used to identify the fault (3.67 KB, application/octet-stream)
2011-11-11 09:11 UTC, Martin Stafford
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Martin Stafford 2011-11-11 09:11:03 UTC
Created attachment 874 [details]
ViewController class containing the code I used to identify the fault

Scenario:

1. Schedule taskA

2. Schedule taskB using taskA.ContinueWith( someaction, TaskContinuationOptions.OnlyOnRanToCompletion)

3. Schedule taskC using taskA.ContinueWith( Action, TaskContinuationOptions.OnlyOnFaulted)

4. Schedule taskD using Task.Factory.ContinueWhenAll<>(new Task<>[] { taskA, taskB }, someaction)

In MonoDevelop running the iOS Simulator:

When taskA completes either taskB or taskC will run.  TaskD never runs as either taskB or taskC (the one that didn't run) is left in a perpetual state of AwaitingActivation.

In VS2010 on Windows 7:

When taskA completes either taskB or taskC will run.  TaskD runs after either taskB or taskC completes.



The documentation for Parallel Tasking says that any task with a conditional continuation will be cancelled when the antecedent task completes and the condition is not met.

if you schedule taskD using Task.Factory.ContinueWhenAny() taskD runs.

code used to ddiscover fault is attached
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-04-04 10:19:04 UTC
Jeremie, I think this is your area.
Comment 2 Jérémie Laval 2012-04-11 11:26:08 UTC
This bug should be fixed in the latest 5.2 release. Could you upgrade to that version?