Hi am writing an application which involves a long loop inside a loop. this
loop can work independently too. so i want to do something like this
for(int i=0;i<5000;i++){
if(some Condition){
raiseEvent
}
}
//in event handler
Thread t=new Thread(this.somemethod);
t.Start()l
//in somemethod
some very log process
So what are the problems i am going to run into.
Whats the better alternative

Signature
Tharx
"If you really want something in this life, you have to work for it. Now,
quiet! They're about to announce the lottery numbers..."
- Homer Simpson
Tom Shelton - 29 Sep 2004 06:14 GMT
> Hi am writing an application which involves a long loop inside a loop. this
> loop can work independently too. so i want to do something like this
[quoted text clipped - 14 lines]
> So what are the problems i am going to run into.
> Whats the better alternative
Are these sub tasks long runing tasks? If they aren't, then I would
suggest maybe using the ThreadPool calss's QueueUserWorkItem method to
initiate queue the tasks you want to run....

Signature
Tom Shelton [MVP]
Sijin Joseph - 29 Sep 2004 18:56 GMT
For a good reading on issues related to multi-threading in .Net refer to
these articles
http://www.yoda.arachsys.com/csharp/threads/
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/wi
nforms06112002.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/wi
nforms01232003.asp
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> Hi am writing an application which involves a long loop inside a loop. this
> loop can work independently too. so i want to do something like this
[quoted text clipped - 14 lines]
> So what are the problems i am going to run into.
> Whats the better alternative