How to achieve the fastest multithreading when searching for passwords?

Closed due to the fact that the essence of the question is not clear to the participants of Pavel Mayorov , VenZell , aleksandr barakin , Dmitriy Simushev , zRrr 2 May '16 at 17:01 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • five
    Just like for any number of handlers. Downstream to the core, and as many cores / processors / computers as possible. </ thread> - VladD
  • @VladD, why not the answer? :) - Grundy
  • It depends on what sort of bust ... If offline, then this is one thing, and if online, then something else. - Pavel Mayorov
  • Go to a clean C, lick up the entire cryptography. - Vladimir Martyanov

1 answer 1

In the absence of a clear statement of the question, I will write general recommendations:

  1. Consider the algorithm of the program, taking into account the execution of several tasks (the use of an effective algorithm can often fundamentally improve performance);
  2. Creating a thread is quite an expensive operation, so to minimize computational costs, use ThreadPool.QueueUserWorkItem (_ => {SomeTask ();}) or Task.Run (), Parallel.Invoke (() => SomeTask ());
  3. If you need to wait for the task to finish and get some results, execute callbacks, handle exceptions, it is best to use the Task Parallel Library based on System.Threding.Tasks.Task
  4. If the tasks are simple, then combine them into packages and add the package to the stream already;
  • And what is the shortest code for the usual password search, the shortest, in your opinion? - komra23
  • @VladD can you know? - komra23