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

How to avoid race conditions with multiple calls to an async function?

In the below example, a call to HandleChangesAsync is made from within an asynchronous task, and via an event handler. I'm concerned there's a potential race condition where one thread is executing the create_task block in HandleChangesAsync. While…
Craig
  • 1,890
  • 1
  • 26
  • 44
0
votes
1 answer

Windows concurrency runtime task scheduling with exceptions

According to MSDN, A task-based continuation is always scheduled for execution when the antecedent task finishes, even when the antecedent task is canceled or throws an exception. I don't understand this because I tried out the following code and…
Michael Kiros
  • 563
  • 4
  • 11
0
votes
0 answers

error LNK2019 of a modified versione of XMLLite library

I modified XMLLite library in order to parse my XML file, then I modified it again in order to have a PPL version of XMLLite lib. My code works so I copied/pasted .cpp and .h file in a project on VS2013 (POSTServer Project) that need to use it. My…
kenhero
  • 95
  • 2
  • 11
0
votes
2 answers

Delphi Berlin PPL TFuture hangs on WAIT in second instance

I've been puzzling over this for several days now. I've have a fairly complex bit of code where a TFuture is hanging. I was sure that I was doing something sinister in my complex code that was causing it. I am amazed that I was able to create a…
Dave Olson
  • 1,435
  • 1
  • 9
  • 16
0
votes
1 answer

Find the Maximum in a List of calculated values using the Parallel Programming Library

I have a list of values. I'd like to find the maximum value. This is a common task. A simple version might be: iBest := -1; iMax := -1e20; for i := 0 to List.Count - 1 do begin if List[i].Value > iMax then begin iBest := i; iMax :=…
Steve Maughan
  • 1,174
  • 3
  • 19
  • 30
0
votes
1 answer

Windows PPL(C++): Is this the correct way to test if a task is done?

Is this the correct way to test if a task is done? const concurrency::task voidTask; if (voidTask != m_getInfoAsync) { if (!m_getInfoAsync.is_done()) { return 0; } } if (voidTask != m_getRangeAsync) { if…
Zingam
  • 4,498
  • 6
  • 28
  • 48
0
votes
1 answer

shared_ptr vs. new operator: which one to use

In the function below I have made use of http_client from cpprestsdk (https://github.com/Microsoft/cpprestsdk) to make http requests to a network camera. The function below is probably a callback called by the lcm library…
0
votes
0 answers

Concurrency::parallel_for in VS2015 SP2

We are using parallel_for in our software to perform easily concurrent execution of some work. Now I was read in https://msdn.microsoft.com/en-us/library/hh409293(v=vs.140).aspx breaking changes + the blog in…
AlfredS
  • 1
  • 3
0
votes
1 answer

How do I wait_any for two things of different type in a loop?

How can I wait for two or more things (with different types) at the same time? Like in an event loop: while(true) { ppl::task msg1 = WaitForLetter(); //one letter a month ppl::task msg2 = WaitForSMS(); //one SMS an hour …
petke
  • 1,345
  • 10
  • 25
0
votes
1 answer

Windows 10 Sockets and MS PPL. TCP connection between server and client breaks after few seconds

My system: Server: Windows 10 Pro 1511 10586.36 Microsoft Visual Studio 2015 Community 14.0.24720.00 Update 1 Client: Windows 10 IoT Core (build 10586) Raspberry Pi 2. My error: Connection establishes successfully, but being lost after a few…
Elia
  • 33
  • 7
0
votes
1 answer

Find max element in array using PPL

I need to implement a function that would find the largest element in the array of floats using ppl.h. I have this code, based on this answer: float find_largest_element_in_matrix_PPL(float* m, size_t dims) { float max_element; int row,…
Denis Yakovenko
  • 3,241
  • 6
  • 48
  • 82
0
votes
0 answers

Compilation fails when using std::bind with Concurrency::parallel_for

Came across a strange compilation error while migrating some old code, which made use of the boost library, to C++11. Specifically, using Visual Studio 2013 Professional Update 5. The following example code fails to compile with error C3848. …
0
votes
2 answers

Passing a parameter to a task in ppl

I'm just beginning to learn ppl in Visual Studio and I began learning about tasks. So far so good, and for example I do understand the basics. But how can I create task that receives an argument? That is, it is fairly straightforward to create task…
Artur
  • 181
  • 1
  • 9
0
votes
1 answer

Class object inside or outside a parallel_for / parallel_for_each?

I have been studying about parallel loops (C++11) and testing them with MS visual studio 2013. I am clear about them (lambdas esp.) which are pretty cool. But my concern is that I have to call a function that performs a simple euclidean distance…
Wajih
  • 793
  • 3
  • 14
  • 31
0
votes
2 answers

SIMD alignment issue with PPL Combinable

I'm trying to sum the elements of array in parallel with SIMD. To avoid locking I'm using combinable thread local which is not always aligned on 16 bytes because of that _mm_add_epi32 is throwing exception concurrency::combinable<__m128i>…
vito
  • 473
  • 1
  • 7
  • 17