tum-vision / lsd_slam

LSD-SLAM
GNU General Public License v3.0
2.6k stars 1.23k forks source link

Fake multithreading in Relocalizer #133

Closed FreeBirdLjj closed 9 years ago

FreeBirdLjj commented 9 years ago

At the 116~121 lines in lsd_slam_core/src/Tracking/Relocalizer.cpp:

    // start threads
    for(int i=0;i<RELOCALIZE_THREADS;i++)
    {
        relocThreads[i] = boost::thread(&Relocalizer::threadLoop, this, i);
        running[i] = true;
    }

and the Relocalizer::threadLoop():

void Relocalizer::threadLoop(int idx)
{
    if(!multiThreading && idx != 0) return;
    ...
}

I think only the thread with index 0 can actually run the body of Relocalizer::threadLoop(), which means whatever multiThreading is, there is at most 1 thread and we can't take advantage of multithreading.

Am I right?


I'm sorry that I mistook the control flow of the program.