Thread synchronization is an intriguing problem. There are a lot of issues
to be aware of. You have hit some, apparently, but you didn't give enough
information for us to actually diagnose your issue.
Does your multithreaded app use a COM component to perform it's work?
What errors are you getting when attempting to write 20 files? What
behavior are you seeing?
Can you share a small but complete sample of code that reproduces your
problem?
Some general resources for information on multi-threading can be found at:
http://www.c-sharpcorner.com/Multithreading.asp
Hope this helps,
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Lyon" <zl*****@gmail.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
Hi everyone:
I have 20 threads and each creats a file in the same directory,
respectively.
However, because the threads are not synchronized, and only some of the
20 threads
creat the file in the directory successfully.
How can I make sure that the 20 threads are able to creat the files in
the same directory successfully??
Thank you very much!
Lyon