top | item 39677097

(no title)

gonzus | 2 years ago

How do you release all the resources created? I could not find any instances of `free()` in the code (and there are two calls to `malloc()`). Are you supposed to call `free()` yourself directly on the executor / task pointers? If so, I would suggest exposing a documented API to dispose of resources.

discuss

order

rkaehn|2 years ago

The tasks themselves come from a pool and are reused automatically, so no call to `free` is needed there. As for the executor, destroying it is a bit involved, because you need to wait for the currently executed task to finish before joining the threads and releasing the resources. It is a feature I do want to work on in the future though.