Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2004

Tip: Looking for answers? Try searching our database.

Threading and Events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
thrax - 29 Sep 2004 01:01 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

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.