Is TArray Thread-Safe?

I’ve a worker thread that I use for computing implicit surface contouring. In the design I made, I need a container to transfer data in/out of the thread.

I use now two TArray and two TQueue and it work well, but it’s a big overhead to use four container if I can only use one.

Hence my question, is TArray Thread-Safe ?

Thanks !

No it is not. You would have to do your own synchronization if you want to use it with multiple threads.There are some thread safe containers. See Containers | Unreal Engine Documentation

1 Like

Thanks for your answer. I’ll see where my design can drive me since TQueue is lock-free.