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
1 answer

Howto use ppl tasks and .then in a loop?

Im trying to learn ppl. Instead of using threads. Lets take it from the beginning. I have this simple problem: v1: while(true) { auto important_msg = ReceiveImportantMessage_Blocking(); //Blocks for about 20s…
petke
  • 1,345
  • 10
  • 25
1
vote
1 answer

PPL: error C3861: 'parallel_for': identifier not found

using win7 x86 and vs2012 I have such code: #include #include "concurrent_vector.h" ..... int pretendletternum[16]; parallel_for(int(0), pretendletternum[vs[vs.size()-1].index], [=,&wordd](int a1) { wchar_t worddd[17];…
1
vote
1 answer

Explain the "=" sign parameter in this Concurrency::Task call

Can someone explain to me what the '=' parameter is used for in this code? What other parameters may I use instead of =? What difference would it make? MSDN isn't very clear on the subject. //Declaration auto prerequisite =…
1
vote
1 answer

Find max element in array OpenMP and PPL versions run much slower than serial code

I'm trying to implement two versions of a function that would find the max element in the array of floats. However, my parallel functions appeared to run much slower than the serial code. With array of 4194304 (2048 * 2048) floats, I get the…
Denis Yakovenko
  • 3,241
  • 6
  • 48
  • 82
1
vote
0 answers

Understanding work_queue & create_thread c++

Understanding the difference between a work_queue or create_thread. My understanding of a work_queue is it executes threads on a kernel which work asynchronously with one another because these have the ability to sleep and be scheduled. My…
Firestratt
  • 33
  • 5
1
vote
1 answer

COM STA model in Parallel Patterns Library (PPL)?

I have MFC application that use Parallel Patterns Library for some asynchronous tasks. Some of them use COM objects, so I need to initialize COM library in such tasks. In all such cases I use COM STA model initialization, because main thread is MFC…
23W
  • 1,413
  • 18
  • 37
1
vote
1 answer

How to process the XML using XmlLite returned by the casablanca (PPL) http_client?

I want to make request to the web service, get the XML content, and parse it to get specific values returned by the service. The code is to be written in native C++11 (MS Visual Studio 2013). The Cassablanca PPL library was chosen. For XML parsing,…
pepr
  • 20,112
  • 15
  • 76
  • 139
1
vote
1 answer

PPL: Initialization of the thread pool

Is there any standard way to pre-initialize the PPL thread pool? The problem is: PPL creates its thread pool at runtime when e.g. parallel_for() is executing. This costs a little performance during the first run, due to creation of additional…
mem64k
  • 748
  • 1
  • 11
  • 25
1
vote
2 answers

C++ Function signature that returns a PPL task?

I am a total noob when it comes to using PPL tasks within the C++ environment, so I am having a hard time to figure out what would be the C++ syntax of the following C# code: private static async Task
Erunehtar
  • 1,583
  • 1
  • 19
  • 38
1
vote
1 answer

How to catch exceptions which occur inside asynchronous methods? (Windows Store app, PPL)

I am trying to catch exception from OnlineIdAuthenticator::AuthenticateUserAsync method, which occurs when there is no internet connection for example. I've found some info about this topic, but it didn't really help me. Here is the code which…
hellobody
  • 430
  • 5
  • 15
1
vote
3 answers

why this C++ code is slower compared to C# variant

Recently, we had a requirement where there are more that 100,000 xml files and all of them needed modification of particular data in the xml. Simple perl command would do the job but perl was not installed on the machine where the files are located.…
Jagannath
  • 3,995
  • 26
  • 30
1
vote
2 answers

How does when_any work?

I have a std::vector< concurrency::task > with a list of tasks that may or may not load in order. I came across the concurrency::when_any call, but don't know enough information about how to use it. I came across this microsoft sample that…
OzBarry
  • 1,098
  • 1
  • 17
  • 44
1
vote
1 answer

Why is class member variable not allowed to be [ &A, &B ] in PPL

Before compile VS says that Error member "test::A" is not a variable Error member "test::B" is not a variable Code: #include #include using namespace concurrency; using namespace std; class test { static double A[ 3 ][ 3…
user2055437
  • 67
  • 1
  • 13
1
vote
1 answer

Task continuation with context "use_current" does not work

I have tried looking for answer to this since three days back. It is either I have done something fundamentally wrong (that there's an obvious mistake) or the thing is too new to have any references, I can't seem to figure why simple cases like this…
Ben Goh
  • 107
  • 1
  • 3
  • 11
1
vote
1 answer

How to set number of PPL threads to one?

I have a number crunching function, so I have paralleled it by using PPL..however another developer requires this function to be run in serial because of some reason..I need to give a parameter so that he can call my function in serial mode...I dont…