Quantcast
Channel: Parallel Computing in C++ and Native Code forum
Viewing all articles
Browse latest Browse all 856

UI thread and task_continuation_context::use_current()

$
0
0

Looks like in nested .then task_continuation_context::use_current() actually does not point to UI thread.

Any way to explicitly specify the UI thread?

Or what is the right way to do this one:

create_task([this](){
   concurrent_vector<task<int>> tasks;
   tasks.push_back(create_task([]()->int{return 1;}));
   tasks.push_back(create_task([]()->int{return 2;}));
   when_all(begin(tasks), end(tasks))
      .then([this](vector<int> results) {
          this->MyListView->Items->Append(L"All tasks completed!");
      },task_continuation_context::use_current());
});


Viewing all articles
Browse latest Browse all 856

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>