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.

135 questions
3
votes
1 answer

Compilation error with C++ Metro App Tutorial - task continuation

I am working through the "Tutorial: Create your first Metro style app using C++" on msdn (link). And shortly into "part 2" of it, I am running into an error. I'm running this on a Windows 8 VM Release Preview (May 31st) with the Visual Studio 2012…
Kevin Anderson
  • 5,815
  • 3
  • 29
  • 52
2
votes
1 answer

Safety of concurrent_vector

it is known that operator [] is not concurrently safe for writing: concurrent_vector::operator[] Operator But what if I guarantee that different threads will write to different vector positions. Like this (very much simplified…
IgorStack
  • 656
  • 1
  • 6
  • 19
2
votes
0 answers

concurrency::parallel_for seem to skip some of parallel loop iterations

Here is the test code: #include #include #include using namespace std; int main() { const size_t n = 1000000; vector processed(n, false); concurrency::parallel_for(0, processed.size(), [&](size_t i)…
Alex
  • 21
  • 1
2
votes
1 answer

What are the benefits of returning a task from a function?

I've seen create_task used in a couple ways: void Bob() { create_task() { /* do stuff */ }.then([](){ /* do more stuff */ }); } and task Bob() { return create_task() { /* do stuff */ }.then([](){ /* do more stuff */ }); } Why bother…
Craig
  • 1,786
  • 1
  • 24
  • 42
2
votes
1 answer

Multithreading alternative to mutex in parallel_for

I'm fairly new to C++, therefore please pardon if this is a stupid question, but I didn't find good example of what I'm looking for on the internet. Basically I'm using a parallel_for cycle to find a maximum inside a 2D array (and a bunch of other…
Noldor130884
  • 984
  • 2
  • 13
  • 35
2
votes
0 answers

What's the best way to return values from parallel_for

I have simple parallel_for loop and results of every iteration I am inserting to concurrent_unordered_map. I see that inserting makes my code much slower. So what is the best way to return pairs from parallel_for to unordered_map? I was trying with…
Queen
  • 171
  • 1
  • 9
2
votes
2 answers

Left Recursion and Right recursion produce same parse tree or not?

This is Right Recursion Grammar: -> = -> A | B | C -> + | -> * | -> ( ) | This is Left Recursion Grammar: -> = -> A |…
kp2349
  • 97
  • 1
  • 12
2
votes
1 answer

break sub task of parallel_for_each

I have a big vector of items that are sorted based on one of their fields, e.g. a cost attribute, and I want to do a bit of processing on each of these items to find the maximum value of a different attribute... The constraint here is that we cannot…
user8709
  • 1,322
  • 13
  • 30
2
votes
0 answers

Fire-and-forget with PPL?

I'm looking to start using PPL in my application. (I'm currently using std::async) I however have two (ugly) cases where I have to call long running functions that don't return any results. (Storing to database, and a network call). I don't wait…
petke
  • 1,027
  • 7
  • 20
2
votes
1 answer

Does PPL take the load of the system into account when creating threads or not?

I am starting to use PPL to create tasks and dispatch them [possibly] to other threads, like this: Concurrency::task_group tasks; auto simpleTask = Concurrency::make_task(&simpleFunction); tasks.run(simpleTask); I experimented with a small…
Patrick
  • 22,097
  • 9
  • 57
  • 125
2
votes
1 answer

What are the distinctive features of ISL and PPL for ClooG when using gcc?

When building or using any given version of gcc, why I should prefer 1 of this 2 backends for ClooG over the other ? I can't find a good documentation about it on the gcc website .
user2485710
  • 8,623
  • 9
  • 48
  • 92
2
votes
2 answers

C++ Thread execution order in a thread pool

Does anyone know of a C++ thread pool implementation that allows both parallel threading (like a typical thread pool) but also allows for back to back serial execution order. I have spent several days trying to make this work by modifying the…
johnco3
  • 2,147
  • 4
  • 28
  • 53
2
votes
2 answers

Find max value with ppl.h

Is there a simple function in the ppl library for C++ where you can do something like Concurrency::max(vec) where vec is a vector of numbers? I can write my own, but I was hoping I could save myself the work. Edit: Sorry I was not clear enough…
spurra
  • 917
  • 2
  • 10
  • 32
2
votes
0 answers

Can process termination be prevented when multiple sub-tasks of a `when_all` throw uncaught exceptions?

The Concurrency Runtime detects when exceptions thrown by tasks cannot be handled and "fails fast"; that is, it terminates the process. I have a case where multiple sub-tasks given to a when_all may throw exceptions. Ideally, I'd like these…
kring
  • 246
  • 1
  • 3
2
votes
2 answers

VC10 PPL or prepare for STL thread

I'm using MSVC 2010 starting a new MFC-project and now trying to decide which lib to use for concurrent tasks. I know of the new C++0x thread features but it's not implemented in VC10. VC12 is not yet an option but it will come in the future. I do…
DaBrain
  • 2,889
  • 2
  • 17
  • 28
1 2
3
8 9