0

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<Letter> msg1 = WaitForLetter(); //one letter a month
    ppl::task<SMS> msg2 = WaitForSMS(); //one SMS an hour

    //wait_any. How to do it for tasks of different types?
}
petke
  • 1,345
  • 10
  • 25

1 Answers1

0

I'll answer my own post.

"PPL Power Pack" supports "Heterogeneous when_any":

https://pplpp.codeplex.com/wikipage?title=Heterogeneous%20when_any

On an unrelated note it seems very few people use PPL. There are only 97 PPL tagged questions on stackoverflow. Most have no answers. (TBB has 450, so it seems a slightly more active community)

petke
  • 1,345
  • 10
  • 25