thomasmoelhave / tpie

Templated Portable I/O Environment
Other
112 stars 24 forks source link

Pipeline resource managment. #212

Closed antialize closed 8 years ago

antialize commented 8 years ago

It would be nice if the following code would work

tp::virtual_chunk<int> method() { tp::passive_sorter<int> s1; return tp::virtual_chunk<int>(s1.input(), s2.output()); }

However it is not clear currently if we need to keep the passive_sorter object around until the pipeline has been executed. We have many such temp objects that we would like to not keep around, such as:

tyilo commented 8 years ago

Everything, but pipeline and nodeset can be safely dealloced before running the pipeline it seems.

Deallocing a pipeline causes a segfault later.

I haven't looked into nodeset, could you give me an example of how you would use nodeset as a temporary object?

antialize commented 8 years ago

Off the top of my head (does not compile)

template virtual_chunk virtual_internal_buffer() { struct C : virtual_container { vector v; }; C * c = new C(); node_set ns = make_node_set(); auto s = virtual_chunk_end(vector_sink(c->v).add_to_set(ns)); auto e = virtual_chunk_begin(vector_source(c->v).add_forwarding_dependencies(ns), c); return virtual_chunk(s, e); }

/Jakob

On 4 Aug 2016 17:40, "Asger Hautop Drewsen" notifications@github.com wrote:

Everything, but pipeline and nodeset can be safely dealloced before running the pipeline it seems.

Deallocing a pipeline causes a segfault later.

I haven't looked into nodeset, could you give me an example of how you would use nodeset as a temporary object?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

tyilo commented 8 years ago

We now don't need to keep any of those objects around as of 42e5ffb31c853b47a39ba8105648b848001b7dbc