Thread safety is a concern when a resource is shared among multiple threads
and these threads try to access the same resource at the same time. If you
don't do this then you are probably thread safe. If you do have a shared
resource it may still not be a problem is all the accesses are read-only.
The problem usually occurs when one or more threads are trying to modify the
resource simultaneously, or when one is modifying it while other threads are
reading it. It may not always be obvious when you are accessing a shared
resource - that is part of your job as a developer.
One simple approach to making your code thread-safe is to take a lock on a
private object whenever you access the shared resource.
"Erik J Sawyer" <ESawyerN-o-S-p-a-m.K12K.com> wrote in message
news:078001c3890a$da2bfce0$a101280aphx.gbl...> I am considering using web services as an alternative to
> DCOM/COM+ components for middle-tier logic. I have
> developed COM+ components in the past, using VB6, but
> they were obviously STA, so threading was a minimal
> My question is, how concerned should I be with making my
> code thread-safe when using a VB or C# web service? Will
> ASP.Net automatically serialize calls so that each
> instance will ignore the others? I am not maintaining
> any component state between calls, and the web service
> component itself is fairly simple and single-threaded.
> Erik J. Sawyer
> Kingsport City Schools