Replies: 3 comments
-
I don't think enkiTS itself should provide task pooling, as this can be provided in user space with no loss of performance/flexibility and enkiTS is itself designed to be lightweight. Whilst The C side does allocate single tasks, and perhaps an improved interface would be to allow arrays of enkiTaskSet* to be allocated. Note that applications should in general try to keep the number of tasks down and use the I can see the benefit of adding an example, or perhaps even an external library which can be used for this. |
Beta Was this translation helpful? Give feedback.
-
I agree that on the C++ side the user should do pooling. And I agree that enkiTS should not see a large number of tasks. On the C side the only option is the custom allocator. Which could be an arena allocator in some cases. So maybe that is not a big problem. Task allocation becomes a bit more complex when binding a library's generic task API to enkiTS. For example, Box2D is issuing some unknown number of tasks that the user has to bind to enkiTS tasks. This is where pooling becomes important. I think enkiTS users would find an example of task pooling and maybe an arena allocator valuable. I might be able to help out with this as I refine the Box2D task API. |
Beta Was this translation helpful? Give feedback.
-
It would be great to see the Box2D task API and have a think about how to make it easier to use with enkiTS. I'm a bit wary of adding any functionality which can be layered on top though, but if there's a way I can extend the API to make certain use cases easier then I will take a look. |
Beta Was this translation helpful? Give feedback.
-
I wonder if enkiTS should provide task pooling. On the C side
enkiCreateTaskSet
calls_aligned_malloc
by default. It would be nice to see some pooling used.Pooling is a bit tricky for the user because
ICompletable
cannot be copied. This prevents the use of standard containers likestd::vector
.I guess this doesn't work in C++ since users can derive from
ITaskSet
, etc. Perhaps the task system could call a method onICompletable
to inform the task that it may be returned to a user task pool.Beta Was this translation helpful? Give feedback.
All reactions