- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I still have trouble understanding the role of task reference count: suppose a parent task created 3 children task and wait for them to finish, then according to the examples, I should set the reference count of the parent task to 3+1=4. But what if I want to have the parent task discarded as soon as it spawns the children tasks, how should I set its reference counter? I'm thinking 0. Wrong answer?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then they should be root tasks instead of child tasks, so they won't try to decrement a reference count that no longer exists, and quite likely you might want to enqueue them instead, but that's difficult to say without knowing why you would want the creating task to be discarded (have you considered a continuation instead?).
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page