For example, this code fragment performs 5,000 thousand iterations (with the interval frc = 0 to frc1 = 50)
for (double fr = frc; fr <= frc1; fr += shag) { double resulting = (1 / (2 * Math.PI)) * integration.Calculate(angularFrequency => GetSpectralDensityOfAmplitude(GetSpectralDensity(U, angularFrequency, T)) * Math.Cos(angularFrequency * t), 0, frc1); list1.Add(fr,resulting); } Naturally, the program hangs for 2-3 minutes, but it gives the result, but still. It happens all 10 minutes freezes (it depends on how much I enter the interval)
And I would like this to not hang. My first attempts to throw a method into the stream were unsuccessful.
Thread thd = new Thread(drawgraph(U,T,frc,frc1,frequency,shag)); thd.Start(); thd.Join(); In theory, it is written that the method to be called in the stream must be without arguments and parameters, must be of type void and not return anything
The problem is that my method is where this void is but there are parameters in it, it’s impossible without them. How can I proceed in my case?
2 procedures are performed in a total of 1 minutes 10 seconds (if you enter the minimum parameters of type 0 and 50)
If you enter large parameters for example -100 to 100, the program freezes for 5 minutes.
Most of the theory that I have read offer work with methods of the void type, but there are no parameters there, and in mine there are nowhere without them
And therefore it is interesting, is it possible in some way to put a method with parameters into a stream?
Joinwaits for the completion of the thread, so it is logical that nothing will change from such a record. - αλεχολυτ