WIP making the sharing between threads safer (threads, instrs, files).