Searching through a huge set with threads
There are definitely some problems if you want to make this threaded. Firstly, access to m_searches is not protected in any way. Since this is a shared bit of memory, it would need to be protected by something (say a mutex) before you modify it.

Generally in situations like these, it's far better to let std::async do a lot of the hard work for you. Also, try and eliminate shared mutable state as much as possible, because it makes life a lot harder. Firstly, let's write a simple search function that'll return an index if we find a match:

const std::size_t not_found = -1;

template &lt;typename Iterator, typename T&gt;
std::size_t find_index(Iterator begin, Iterator end, 
                       const T&amp; value, std::size_t start)
{
    std::size_t s = start;
    Iterator it = begin;

    while(it != end) {
        if(*it == value) {
            return s;
        }
        ++s;
        ++it;
    }

    return not_found;
}


Ok, this is just our normal linear search, but it allows us to start from anywhere in our search range since we're only passing in a few iterators.

Next, we define a vector to search over:

std::vector&lt;int&gt; v { 4, 5, 1, 3, 9, 8, 7, 6, 11, 42, 13 };
typedef typename std::vector&lt;int&gt;::iterator iter_t;


Create our vector of future to hold results:

std::vector&lt;std::future&lt;std::size_t&gt;&gt; futures;


And then populate it:

futures.emplace_back(
    std::async(std::launch::async, find_index&lt;iter_t, int&gt;, 
               v.begin(), v.begin() + 6, 8, 0));
futures.emplace_back(
    std::async(std::launch::async, find_index&lt;iter_t, int&gt;, 
               v.begin() + 6, v.end(), 8, 6));


Note the std::launch::async flag specifies we want to create a new thread to run our function in. I've hardcoded the search start and end places here, but you can obviously add some logic to split things up evenly if you'd like. Also, note that we need to explicitly define the template types here, since they won't be deduced.

Now we'll set up a vector to store our results in, and get the results back:

std::vector&lt;std::size_t&gt; results;
for(auto&amp; future : futures) {
    results.emplace_back(future.get());
}


Finally, print out anything that was found:

std::for_each(results.begin(), results.end(),
              [](std::size_t index)
              { if(index != not_found) std::cout &lt;&lt; index &lt;&lt; "\n"; });
}


The whole thing can be found here.

Hopefully this gives you an idea of a different way of approaching your problem.