Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Yes, you can parellelize this trivially, but think a bit beforehand -- surely you don't want thousands of threads, but only as many as yu have physical cores. So you really just want to partition the index space. Commented Mar 13, 2014 at 20:12
  • First thing that comes to mind is Boost Threads stackoverflow.com/questions/415994/boost-thread-tutorials Commented Mar 13, 2014 at 20:12
  • C++11 has support for threads in the standard library. If kpts.size() is large and/or perform_operation() is very expensive then it might be worth parallelizing. Commented Mar 13, 2014 at 20:13
  • @KerrekSB I will definitely partition kpts1 so that the max number of threads equals the cores (I'm still deciding which AWS instance I will be using, so I don't know the max cores at the moment). But for argument, lets say I want to split this up into 8 processes. How could I do that? Commented Mar 13, 2014 at 20:15
  • Here's a tutorial for C++11 threads solarianprogrammer.com/2011/12/16/cpp-11-thread-tutorial Commented Mar 13, 2014 at 20:44