Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
AnswerRe: get GC to collect unused memory Pin
Dave Kreskowiak4-Nov-05 5:52
mveDave Kreskowiak4-Nov-05 5:52 
GeneralRe: get GC to collect unused memory Pin
Jon Rista4-Nov-05 16:33
Jon Rista4-Nov-05 16:33 
GeneralRe: get GC to collect unused memory Pin
Dave Kreskowiak5-Nov-05 2:49
mveDave Kreskowiak5-Nov-05 2:49 
GeneralRe: get GC to collect unused memory Pin
Jon Rista5-Nov-05 9:57
Jon Rista5-Nov-05 9:57 
QuestionMost elegant way to query 400 computers in C#? Pin
artisticcheese4-Nov-05 4:44
artisticcheese4-Nov-05 4:44 
AnswerRe: Most elegant way to query 400 computers in C#? Pin
Rob Graham4-Nov-05 5:14
Rob Graham4-Nov-05 5:14 
GeneralRe: Most elegant way to query 400 computers in C#? Pin
artisticcheese4-Nov-05 5:17
artisticcheese4-Nov-05 5:17 
AnswerRe: Most elegant way to query 400 computers in C#? Pin
S. Senthil Kumar4-Nov-05 21:39
S. Senthil Kumar4-Nov-05 21:39 
You can use the ThreadPool class provided by the .NET Framework, but it's not really recommended for executing long running operations (in the order of 20 seconds). You can find plenty of implementations for ThreadPools if you search around in CP. In any case, the idea is the same.
void YourMainFunc()
{
  for (int i =0; i<listOfIPs.Length; ++i)
  {
     ThreadPool.QueueItem(ThreadFunc, listOfIPs[i]);
  }
}

void ThreadFunc(string IP)
{
   if (SuccessfulQuery(IP))
   {
      UpdateDataSet(IP);
   }
}

void UpdateDataSet(IP)
{
   lock(xyz)
   {
      //make changes to dataset
   }
}


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Most elegant way to query 400 computers in C#? Pin
artisticcheese5-Nov-05 2:31
artisticcheese5-Nov-05 2:31 
GeneralRe: Most elegant way to query 400 computers in C#? Pin
S. Senthil Kumar5-Nov-05 3:17
S. Senthil Kumar5-Nov-05 3:17 
QuestionRemoting - recovering communication Pin
duff794-Nov-05 4:37
duff794-Nov-05 4:37 
QuestionAny good C# 2.0 books out yet? Pin
Ed K4-Nov-05 3:46
Ed K4-Nov-05 3:46 
QuestionUnTrapping of Mouse Events Pin
wheelerbarry4-Nov-05 3:38
wheelerbarry4-Nov-05 3:38 
AnswerRe: UnTrapping of Mouse Events Pin
Dave Kreskowiak4-Nov-05 5:47
mveDave Kreskowiak4-Nov-05 5:47 
QuestionRichtextbox Pin
PaulaM4-Nov-05 2:38
PaulaM4-Nov-05 2:38 
AnswerRe: Richtextbox Pin
mav.northwind4-Nov-05 2:49
mav.northwind4-Nov-05 2:49 
QuestionHTTP Protocols C# Pin
TAREQ F ABUZUHRI4-Nov-05 1:29
TAREQ F ABUZUHRI4-Nov-05 1:29 
AnswerRe: HTTP Protocols C# Pin
S. Senthil Kumar4-Nov-05 3:34
S. Senthil Kumar4-Nov-05 3:34 
AnswerRe: HTTP Protocols C# Pin
Ed K4-Nov-05 3:51
Ed K4-Nov-05 3:51 
QuestionHow to not close a form? Pin
patgo4-Nov-05 1:07
patgo4-Nov-05 1:07 
AnswerRe: How to not close a form? Pin
ventomito4-Nov-05 7:34
ventomito4-Nov-05 7:34 
QuestionNetworking Help!!!Please Pin
snouto4-Nov-05 0:24
snouto4-Nov-05 0:24 
AnswerRe: Networking Help!!!Please Pin
Guffa4-Nov-05 4:03
Guffa4-Nov-05 4:03 
Questionlooking for a control (newbie) Pin
Dragan Matic3-Nov-05 23:42
Dragan Matic3-Nov-05 23:42 
AnswerRe: looking for a control (newbie) Pin
MoustafaS4-Nov-05 0:14
MoustafaS4-Nov-05 0:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.