std :: map插入线程安全吗?

我知道map在两个线程中的读写线程不安全。 但是可以插入多个线程吗?

void writeMap()
{ 
    for (int i = 0; i < 1000; i++)
    {
        long long random_variable = (std::rand()) % 1000;
        std::cout << "Thread ID -> " << std::this_thread::get_id() << " with looping index " << i << std::endl;
        k1map.insert(std::make_pair(i, new p(i)));
    }
}

int main()
{
    std::srand((int)std::time(0)); 
    for (int i = 0; i < 1000; ++i)
    {
        long long random_variable = (std::rand()) % 1000;
        std::thread t(writeMap);
        std::cout << "Thread created " << t.get_id() << std::endl;
        t.detach();
    }
    return 0;
}

就像这样的代码正常运行,无论我尝试多少次。