Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
As mentioned in this question, autoloading within a thread can cause problems. What work-arounds can be applied?
在产生线程之前,您可以简单地要求包含您需要的类的文件。运行起来比简单地使用 autorequires 需要更多的工作,但这里是必要的。
这样,您就可以避免由于竞速条件而在多个线程上加载一个类。
const_missing你可以用一个加上一个互斥体来滚动你自己的。
const_missing