how to make an application so fast, in terms of speed
-
Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks
Devesh Mishra
-
Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks
Devesh Mishra
As opposed to fast in terms of.... ? If it searches the same machines over and over, you can build an index on those machines and search that instead. If the machines change, you can buy faster network cards.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
As opposed to fast in terms of.... ? If it searches the same machines over and over, you can build an index on those machines and search that instead. If the machines change, you can buy faster network cards.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Thanks for your reply. I am searching the network computers from the network directory. Its not searching the same machine over and over. Now tell me that how can i improve the speed or is there any other way to search the network computers. Thanks
Devesh Mishra
-
Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks
Devesh Mishra
You could rely on the information Windows itself is holding; see several CP articles, e.g. http://www.codeproject.com/useritems/ExplorerTree.asp[^] If you want to discover network computers yourself (say with ping), you must avoid doing it completely sequentially; so you may want to use a couple of threads (I suggest no more than 4), as has been the topic of many forum items before. :)
Luc Pattyn [My Articles] [Forum Guidelines]
-
Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks
Devesh Mishra
aHi, i think you need to start several threads at once!
-
aHi, i think you need to start several threads at once!
Hi Thanks for ur reply.. But plz tell me that how can i start multiple thread at once... Thanks
Devesh Mishra
-
Hi Thanks for ur reply.. But plz tell me that how can i start multiple thread at once... Thanks
Devesh Mishra
there are many kinds of threads: the basic one is :
private void MethodA() { System.Threading.Thread t1 = new Thread(new ThreadStart(MethodB)) System.Threading.Thread t2 = new Thread(new ThreadStart(MethodC)) } private void MethodB() { // Do some work } private void MethodC() { // Do some work }
if the methods that you want to call have input, so you need to use a parametrized thread :using System; using System.Threading; public class Work { public static void Main() { // To start a thread using a shared thread procedure, use // the class name and method name when you create the // ParameterizedThreadStart delegate. // Thread newThread = new Thread( new ParameterizedThreadStart(Work.DoWork)); // Use the overload of the Start method that has a // parameter of type Object. You can create an object that // contains several pieces of data, or you can pass any // reference type or value type. The following code passes // the integer value 42. // newThread.Start(42); // To start a thread using an instance method for the thread // procedure, use the instance variable and method name when // you create the ParameterizedThreadStart delegate. // Work w = new Work(); newThread = new Thread( new ParameterizedThreadStart(w.DoMoreWork)); // Pass an object containing data for the thread. // newThread.Start("The answer."); } public static void DoWork(object data) { Console.WriteLine("Static thread procedure. Data='{0}'", data); } public void DoMoreWork(object data) { Console.WriteLine("Instance thread procedure. Data='{0}'", data); } } /* This code example produces the following output (the order of the lines might vary): Static thread procedure. Data='42' Instance thread procedure. Data='The answer' */
For more examples, search in the MSDN Library ;)