Global Lock when copying Trefs with multiple threads

Hi @pcanal,

re: standalone: we will try to come up with something, maybe @mmoanis has something already? Otherwise I think the standalone program to reproduce it in Copying TRefs and accessing TRef data from multiple threads should also still work

re: TRefArray: we had some very strange issues when writing TRefArrays to a file and accessing them later on. This is why we exchanged them for a vector. Would you expect a better performance when using TRefArray?

Thanks for looking into this!
Simon