Closed kvark closed 2 years ago
This doesn't work because we are eagerly dropping the functions/closures regardless of what forked tasks are doing.
Also, looks like this approach is a no-go. FnOnce
body is dropped on execution, so we can't hold the associated data longer.
This PR introduces a mechanism for having non-static task bodies. In particular, when forking tasks, we can guarantee that their closures will die before the parent closure dies. This drastically improves the
qsort
case ergonomics.Draft because it needs a careful look at safety, and doesn't work yet: