Questions tagged [ppl]

The Parallel Patterns Library (PPL) is a C++ library included with Microsoft Visual C++ 2010+ that provides an imperative programming model that promotes scalability and ease-of-use for developing concurrent applications.

The Parallel Patterns Library (PPL) is a C++ library included with Microsoft Visual C++ 2010+ that provides an imperative programming model that promotes scalability and ease-of-use for developing concurrent applications.

142 questions
1
vote
0 answers

How do I write a boost asio completion token which adapts to a non-asio coroutine library (PPL tasks)?

I'm trying to use Microsoft's Parallel Patterns Library's coroutines in my code, which uses Asio for most of its async stuff. The cleanest way would be to define a token, use_ppl, which somehow behaves the same way as asio::use_awaitable but for ppl…
MHebes
  • 2,290
  • 1
  • 16
  • 29
1
vote
1 answer

PPL concurrency and co_await causes lambda capture variables to go out of scope at suspend

If I call concurrency::create_task([self,this]() -> concurrency::task { co_await 5s; //or really any task that suspends until complete MemberFunction(); co_return; }); after the suspension point when I call MemberFunction() the this…
Joseph
  • 308
  • 1
  • 9
1
vote
1 answer

What could be causing an "unresolved external symbol IID_ICallbackWithNoReentrancyToApplicationSTA" error?

Just googling or duckduckgo'ing unresolved external symbol IID_ICallbackWithNoReentrancyToApplicationSTA Only brings up a single direct hit and that doesn't even help the person reporting the problem, so I'm hoping some C++/WinRT people run…
kayleeFrye_onDeck
  • 6,648
  • 5
  • 69
  • 80
1
vote
1 answer

Access Violation caused by Indy SSL component finalization (PPL / TTask)

I'm using Delphi version (Delphi 10.2u2) My goal is to play with a web service to process multi-threaded GET, POST commands through Indy framework, nothing really complex and everything works fine until I close the application during a request. To…
Phr0zeN
  • 21
  • 2
1
vote
1 answer

How does create_async behave on the UI thread?

Let's say I have a function that I call on the UI thread: IAsyncOperation^ GetImage() { return create_async([] { return create_task(GetStreamAsync()) .then([] (Stream^ stream) { auto…
Craig
  • 1,890
  • 1
  • 26
  • 44
1
vote
1 answer

Do I need to synchronize my destructor with async functions when using PPL?

Let's say I have a ViewModel that can be destroyed when a user navigates away from its bound View. The destructor performs cleanup on a subscription member variable: MyViewModel::~MyViewModel() { if (m_subscription) { if…
Craig
  • 1,890
  • 1
  • 26
  • 44
1
vote
1 answer

Do I ever need create_async within a single-language UWP app?

I want to better understand PPL tasks in managed C++ (as in, C++/CX). One point I'm unclear on is using create_task vs create_async. MS documentation says: Use create_async only when you have to create functionality that can be accessed from…
Craig
  • 1,890
  • 1
  • 26
  • 44
1
vote
0 answers

PPL get Compiling Errors when run command

I need to run some ppl code in ppl command. Here is the code: service tar0_starter function start const pathFolder= OS.consol?.ask_string ("Please enter at path of file:") if_null: error const my_folder =…
foo
  • 443
  • 2
  • 8
  • 22
1
vote
0 answers

PPL task call in a while C++

I'm working on a crossover remote working job test and i use Cpp Rest Casablanca. I need to parse an XML file so i found on google this xml parser (it seems to be the fastest…
kenhero
  • 95
  • 2
  • 11
1
vote
0 answers

HTTP Server cpprest POST handle a filestream

I found on google this code that basically upload a file to a HTTP Server in Async mode via cpprest. If i have sufficiently enough (i'm newbye to PPL and cpprest and read lots of web pages on msdn) i create a task that open an ifstream from out.txt…
kenhero
  • 95
  • 2
  • 11
1
vote
0 answers

tokenize and parse concurrently

Given the new c++17 standard is bringing in more flexibility to concurrency and std::feature and tasks in particular. I was wondering if I can use the "tasks" (I'm using Microsoft implementation, ppl) to do some kind of concurrent Parsing and…
asp5
  • 371
  • 1
  • 10
1
vote
1 answer

parallel_for ppl.h not faster than sequential c++

I have code like this (pseudocode, because I can't show my program): concurrent_vector a, b, c; concurrent_unordered_map mapForResult; for(i=0; iread(&a, &b,…
Queen
  • 173
  • 1
  • 11
1
vote
0 answers

Visual C++: Parallel Patterns Library - How to cancel task returned by a factory method?

According to the MSDN I can cancel a task as follows: cancellation_token_source cts; auto token = cts.get_token(); auto t = create_task([] { bool moreToDo = true; while (moreToDo) { if (is_task_cancellation_requested()) …
Zingam
  • 4,498
  • 6
  • 28
  • 48
1
vote
2 answers

Delphi - Read in a Large File using IFuture from the Parallel Programming Library

I'm reading in some large(ish) excel file which take "ages" to load. I can load it in before I really need to access it. So I thought this would be a good use for an IFuture from the Parallel Programming Library. But I'm not sure how to go about it…
Steve Maughan
  • 1,174
  • 3
  • 19
  • 30
1
vote
1 answer

C++ concurrency::concurrent_vector

I am having issues with the following piece of code while using threads. I read on the Microsoft site that appending to the concurrent_vector does not mess with iterators, so I did not provide and mutex for the duration of the find_if operation. So…
muscleman71
  • 91
  • 2
  • 13