Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Implicit destructor for Task's data when type is not trivially destructible #4

Conversation

LuisAntonRebollo
Copy link

@LuisAntonRebollo LuisAntonRebollo commented Apr 5, 2019

As performance of Task's data destructors can be a problem, i tried to find a way to reduce the cost and use it only when types required it.

The main idea is to inline the task execution code in a wrapper together with the code for destruction, in this way we dont need to add any additional indirect function call.

Note this PR is mostly for discussion about the idea, as i feel i have not sufficient knowledge on how GTS works.

Note: Use lambdas for the task function only will work with c++20.

Sorry, if I'm missing some important detail and the idea is failing :P

@LuisAntonRebollo
Copy link
Author

Example of how to use task's functions with the new interface:

Task *task0 = taskScheduler.allocateTaskWithData<TestCountTask, &test_t::taskFunc>(10);
Task *task1 = taskScheduler.allocateTaskWithData<test_t>();

@LuisAntonRebollo LuisAntonRebollo deleted the feature_task_data_destructor branch April 13, 2019 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants