As mentioned in this question, autoloading within a thread can cause problems. Wha开发者_如何学Ct work-arounds can be applied?
You can simply require the files containing the classes you need, before spawning threads. It is a bit more work to get running than simply using autorequires, but it is necessary here.
That way you avoid having a class being loaded on multiple threads due to racing conditions.
You could roll your own with a const_missing
plus a Mutex.
精彩评论