#include <iostream>
#include <thread>

void foo() {

    for (int i = 0; i < 20; ++i) {
        std::cout << "foo" << std::endl;
    }
}


int main(int argc, char** argv) {

    std::thread first(foo);
    for (int i = 0; i < 20; ++i) {
        std::cout << "main" << std::endl;
    }
    first.join();
    return 0;
}