|
| 1 | +# Task Issues Overview |
| 2 | + |
| 3 | +A brief overview of the issues based on two lists (there is some |
| 4 | +overlap between the two lists; the initials are used to reference |
| 5 | +the respective issue): |
| 6 | + |
| 7 | +- Lewis's list [LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org) |
| 8 | +- Dietmar's list [DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md) (build nearly complete from Mattermost feedback) |
| 9 | + |
| 10 | +## Task is eager |
| 11 | + |
| 12 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#task-is-not-actually-lazily-started) |
| 13 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#task-is-not-actually-lazily-started) |
| 14 | + |
| 15 | +- the current spec implies eager start |
| 16 | +- the intent is to establish task's invariant (scheduler affinity) |
| 17 | +- fix: `initial_suspend() -> suspend_always` and constraint start |
| 18 | +- commment: rephrase to clarify it is resumed later |
| 19 | + |
| 20 | +## Initial resume shouldn't reschedule |
| 21 | + |
| 22 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#task-should-not-unconditionally-reschedule-when-control-enters-the-coroutine) |
| 23 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#task-should-not-unconditionally-reschedule-when-control-enters-the-coroutine) |
| 24 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#starting-a-task-reschedules) |
| 25 | + |
| 26 | +- `initial_suspend()`'s spec implies reschedule |
| 27 | +- fix: constrain `start(rcvr)` to be called on `get_scheduler(get_env(rcvr))` instead |
| 28 | +- comment: the description from `initial_suspend()` merely lays out what needs to hold => that's OK |
| 29 | + |
| 30 | +## Shouldn't reschedule after `co_await`ing task |
| 31 | + |
| 32 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#task-awaiting-another-task-should-not-reschedule-on-resumption) |
| 33 | + |
| 34 | +- `await_transform` uses `affine_on` without enough context information => reschedule |
| 35 | +- fix: specify a custom `affine_on` for `task` and arrange for various things |
| 36 | +- comment: how can a user tell what exactly happened? the `co_await`ing `task` and the `co_await`ed task are from the implementation |
| 37 | + |
| 38 | +## No symmetric transfer |
| 39 | + |
| 40 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#task-coroutine-awaiting-another-task-does-not-use-symmetric-transfer) |
| 41 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#no-support-for-symmetric-transfer) |
| 42 | + |
| 43 | +- `co_await tsk;` doesn't use symmetric transfer |
| 44 | +- fix: require symmetric transfer |
| 45 | +- comment: recommended practice? the `task`s can communicate appropriately |
| 46 | + |
| 47 | +## no support for non-senders |
| 48 | + |
| 49 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#minor-task-does-not-accept-awaiting-types-that-provide-as_awaitable-but-that-do-not-satisfy-sender-concept) |
| 50 | + |
| 51 | +- `as_awaitable` isn't used |
| 52 | +- fix: use `as_awaitable` |
| 53 | +- comment: how to guarantee affinity? seems to require an additional coroutine |
| 54 | +- don't do? |
| 55 | + |
| 56 | +## affine_on has no default spec |
| 57 | + |
| 58 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#affine_on-is-missing-a-specification-for-a-default-implementation) |
| 59 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#affine_on-underspecified) |
| 60 | + |
| 61 | +- there is no default specification of what `affine_on` does. |
| 62 | +- fix: say something specific |
| 63 | +- comment: we don't have the tools to say what implementations can do for known senders |
| 64 | + |
| 65 | +## affine_on semantics unclear |
| 66 | + |
| 67 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#affine_on-semantics-are-not-clear) |
| 68 | + |
| 69 | +- the wording is unclear |
| 70 | +- fix: two versions |
| 71 | +- comment: I think I had the 2nd in mind |
| 72 | + |
| 73 | +## affine_on shape |
| 74 | + |
| 75 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#affine_on-might-not-have-the-right-shape) |
| 76 | + |
| 77 | +- `affine_on` should just depend on the receiver's `get_scheduler()`. |
| 78 | +- comment: agreed - that is design, though |
| 79 | + |
| 80 | +## affine_on: schedule vs. stop token |
| 81 | + |
| 82 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#affine_on-should-probably-not-forward-stop-requests-to-reschedule-operation) |
| 83 | + |
| 84 | +- non-success completions don't guarantee affinity invariant |
| 85 | +- fix: suppress stop token |
| 86 | +- comment: in case of `set_stopped()` the coroutine doesn't resume; for `set_error(e)` other reasons may exist |
| 87 | +- comment: however, I don't object to this direction |
| 88 | + |
| 89 | +## affine_on vs. other algorithms |
| 90 | + |
| 91 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#we-should-probably-define-customsiations-for-affine_on-for-some-other-senders) |
| 92 | + |
| 93 | +- `affine_on(sch, sndr)` should behave special for some `sndr` |
| 94 | +- fix: specify some of the interactions |
| 95 | +- comment: I think an implementation can do these; once we have better tools we may want to require some |
| 96 | + |
| 97 | +## promise_type vs with_awaitable_sender |
| 98 | + |
| 99 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#minor-taskpromise_type-doesnt-use-with_awaitable_senders---should-it) |
| 100 | + |
| 101 | +- should it use `with_awaitable_sender`? |
| 102 | +- potential fix: have affinity aware `with_awaitable_sender` variant? |
| 103 | +- comment: there are multiple tools which may be useful |
| 104 | + |
| 105 | +## unhandled_stopped should be noexcept |
| 106 | + |
| 107 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#taskpromise_typeunhandled_stopped-should-be-marked-noexcept) |
| 108 | + |
| 109 | +- fix: do it! |
| 110 | +- comment: for consistency it should be `noexcept` |
| 111 | + |
| 112 | +## allocator type not specified |
| 113 | + |
| 114 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#behaviour-when-the-tasks-environment-type-does-not-specify-an-allocator_type) |
| 115 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#unusual-allocator-customisation) |
| 116 | + |
| 117 | +- generator uses the allocator anyway |
| 118 | +- fix: use type-erased allocator in that case like generator |
| 119 | +- comment: that's an oversight; I didn't realize generator does that |
| 120 | + |
| 121 | +## allocator_arg more permissive |
| 122 | + |
| 123 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#handling-of-allocator_arg-is-more-permissive-than-for-stdgenerator) |
| 124 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#issue-flexible-allocator-position) |
| 125 | + |
| 126 | +- generator requires allocator in first position |
| 127 | +- fix: should generator be generalized? |
| 128 | +- comment: yes but not for C++26 |
| 129 | + |
| 130 | +## hiding parent's allocator |
| 131 | + |
| 132 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#minor-task-environments-allocator_type-overrides-the-parent-environments-get_allocator) |
| 133 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#shadowing-the-environment-allocator-is-questionable) |
| 134 | + |
| 135 | +- task's allocator (from ctor) hides receiver's allocator |
| 136 | +- fix: allow receiver's allocator through |
| 137 | +- comment: that misaligns with my understanding of the allocator model |
| 138 | + |
| 139 | +## no stop_source in promise |
| 140 | + |
| 141 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#taskpromise_type-should-not-contain-a-stop-source) |
| 142 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#a-stop-source-always-needs-to-be-created) |
| 143 | + |
| 144 | +- the stop_source is only need for misaligned stop tokens |
| 145 | +- fix: have the stop source in promise and only when needed |
| 146 | +- comment: I think that is already allowed; maybe should be clarified, recommended practice? |
| 147 | + |
| 148 | +## stop_token default constructible |
| 149 | + |
| 150 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#taskpromise_type-wording-assumes-that-stop-token-is-default-constructible) |
| 151 | + |
| 152 | +- the exposition-only member for stop_token require default constructible |
| 153 | +- fix: don't have it: get it from env or stop source |
| 154 | +- comment: I think that is alrady allowed |
| 155 | + |
| 156 | +## coro frame destroyed too late |
| 157 | + |
| 158 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#task-coroutine-state-is-not-destroyed-early-enough-after-completing) |
| 159 | + |
| 160 | +- frame should be destroyed before completing |
| 161 | +- fix: result in state, destroy before completing |
| 162 | +- comment: that is what I had hoped to say - may need wording fix |
| 163 | + |
| 164 | +## inefficient env |
| 165 | + |
| 166 | +[LB](https://github.com/lewissbaker/papers/blob/master/isocpp/task-issues.org#taskpromise_typeget_env-seems-to-require-an-inefficient-implementation) |
| 167 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#the-environment-design-is-odd) |
| 168 | + |
| 169 | +- own_env must copy lots of state |
| 170 | +- comment: own_env just allows a potential type-erase entity to be workable, primarily it is env |
| 171 | + |
| 172 | +## no completion scheduler |
| 173 | + |
| 174 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#no-completion-scheduler) |
| 175 | + |
| 176 | +- `task` doesn't expose a completion scheduler |
| 177 | +- comment: it can't have one |
| 178 | +- fix: redesign get_completion_scheduler(sender, env) or get_completion_scheduler(os) |
| 179 | + |
| 180 | +## future coro may not need `co_yield error` |
| 181 | + |
| 182 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#a-future-coroutine-feature-could-avoid-co_yield-for-errors) |
| 183 | + |
| 184 | +- sure |
| 185 | + |
| 186 | +## no hook to capture/restore TLS |
| 187 | + |
| 188 | +[DK](https://github.com/bemanproject/task/blob/issues/docs/issues.md#there-is-no-hook-to-capturerestore-tls) |
| 189 | + |
| 190 | +- legacy APIs may need TLS to be set appropriately |
| 191 | +- objective: capture TLS before async, restore after |
| 192 | +- fix: use custom affine_on with wrapped scheduler, delegating |
0 commit comments