Re: static classes & threading
- From: "Gabriel Lozano-Morán" <gabriel.lozano@xxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 20:08:50 +0200
That's the whole point of multithreading :) So unless there is a
mutual-exclusion lock in your method the second thread will not wait for the
first thread to finish executing the static method.
Gabriel Lozano-Morán
Software Engineer
Sogeti
"Frank Rizzo" <none@xxxxxxxx> wrote in message
news:eWMX0gQRFHA.2252@xxxxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> I have a class with all static methods that is called by multiple threads.
> I was wondering what effect that has on the competing threads.
> Does Thread2 have to wait until Thread1 is done with the
> StaticClass.Method1 before it can use it?
>
> What if I removed static methods and made all the threads instantiate its
> own copy of the class? Would that remove the waiting contention?
>
> Thanks.
.
- Follow-Ups:
- Re: static classes & threading
- From: Frank Rizzo
- Re: static classes & threading
- References:
- static classes & threading
- From: Frank Rizzo
- static classes & threading
- Prev by Date: Re: TextBox and decimal numbers
- Next by Date: Re: TextBox and decimal numbers
- Previous by thread: static classes & threading
- Next by thread: Re: static classes & threading
- Index(es):
Relevant Pages
|