Can I use a StringBuilder in a Parallel.ForEachloop
I like to make a concatenate string, in a foreach loop (a parallel.ForEach loop). In the loop there is a lot of code, the concatenated string is just a datacollector. The string is saved for logging purposes. If I do it in my real life application the concatenated string turns out to have most of the data but scattered around in no particular order. When I try is in the playground it seems to work but there is al lot less going on there. https://code.sololearn.com/cLDh9QeOE0Kn How work with stringbuilder in a way that is threadsafe ?