boost json 파서는 boost :: spirit에 의존하고 spirit은 스레드 안전성 기본값이 아니기 때문입니다.이 매크로를 ptree 헤더 파일 앞에 추가하여 해결할 수 있습니다. #define BOOST_SPIRIT_THREADSAFE #include #include ------------------- 요약 :내 제안 : 원자 스왑 관용구 사용 ptree my_shared; mutex shared_ptree_lock; { ptree parsed; // temporary read_json(ss,pt); // this may take a while (or even fail) lock_guard hold(shared_ptree_lock); std::swap(pt, my_shared); // swa..