News for hackers. Stuff that matters.
Re:How to think about `async`/`await` in Rust by dminik on Wednesday July 05, 2023 @06:16AM (#36598267)
Since rust follows RAII, any and all resources allocated in the context should be deallocated when their destructor (the drop trait) is called. The unfortunate exception to this are resources which require an async call to deallocate properly. Though this can be worked around and there is work being done to fix this properly.
Re:How to think about `async`/`await` in Rust by heavenlyblue on Wednesday July 05, 2023 @01:05PM (#36603405)
> Since rust follows RAII, any and all resources allocated in the context should be deallocated when their destructor (the drop trait) is called. The unfortunate exception to this are resources which require an async call to deallocate properly. Though this can be worked around and there is work being done to fix this properly.

Yeah as I said async does not, in fact, "provide easily cancellable execution patterns".

Re:How to think about `async`/`await` in Rust by Matthias247 on Wednesday July 05, 2023 @05:22PM (#36607336)
only if the resources are just used within this task. If an async function at some point in time generates another task (or even spawns a thread!) that can not be synchronously cancelled then it might outlive the destructor and thereby the async task. It's therefore nowhere near guaranteed that every Future can just be dropped to stop an action in a side-effect free fashion.