I am having some trouble with multithreading and throughput.
later in my code . . .
. . .
The above is just a portion of the code I am dealing with, but after much testing, everything performs as expected except the .ToXml(). It performs very slowly compared to its single threaded equivalent. The elapsed time for a single thread (i.e., threadIdx=0) is roughly the same as when having 4 threads. In other words, if I comment out the line with the .ToXml(), multithreading gives me the throughput I am looking for.
Is .ToXml() thread safe? Is the above legal/supported? Any thoughts on this is appreciated.
asked Jul 02 '12 at 23:36
After reviewing the internal Chilkat source, I think I see the problem and it has to do with the multi-thread safety. These new builds should fix it:
answered Jul 03 '12 at 16:07