Today I profiled one of my C# applications using the Visual Studio 2010 Performance Analyzer. Specifically, I was profiling for \"Concurrency\" because it s
Without really knowing the structure of your program, I can only really tell you what Synchronization means in relation of threads. I can't really tell you what the problem in your program is.
Synchronization basically means that you coordinate so to speak the concurrent running of threads when actions have to be taken on resources that are shared by these threads, in order to avoid corruption of your data.
If you have an string
, for example, that your two threads are writing to, then, if you didn't have thread synchronization (ie using AutoResetEvents or Semaphores, etc) then one thread could be in the middle of altering the string in some fashion, be interrupted by the OS (maybe it's time slice was up), and now the second thread may be starts reading from this string, which is in an indeterminate state. This will wreak having with your program, so in order to avoid such things, and many other possible errors that can be caused by threading, you synchronize access to the shared resource, by locking it, so that only one thread at a time can write/read to/from it, and any other thread wanting to do so while the other is doing so, has to wait until our first thread has released the lock it holds.
This is, in a very simplified explanation, what thread synchronization means and what it is for.
There is many more things that come with threading, but that's the subject of an entire book.
As to what your "Synchronization State of Threads" may mean, I would guess it means that a lot of threads spend their time waiting on other threads that are holding some shared resource.
Essentially that means your program is really not working concurrently, but is doing things in serial, as threads are spending their time waiting on other threads. This means that the program is not written very well to really work concurrently, which, by the way is not necessarily an easy feat to achieve, depending on the situation, obviously.
Hope this helps.