Boost logo

Boost Users :

Subject: [Boost-users] Invoke several functions with the same thread
From: Shaolin (shaolinfinest_at_[hidden])
Date: 2009-08-22 18:00:00


Hi Guys

I am trying to convert my application to a multithreaded app. Please see
code below:

boost::thread_group threads;
FileThread *fThreads[filearr.size()];

for(int i=0; i < filearr.size(); i++) {
    fThreads[i] = new FileThread(filearr[i]);
    threads.create_thread(fThreads[i]->find());
}
threads.join_all();

As you can see from the code above, I have an array of FileThread objects,
which have several functions. What I want to do, is to first off invoke the
find() function which will go through some algorthms (this is already done)
and then the print() function which will print the results. How can I invoke
the print() function with the same thread ?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net