1
I have a project where I need to start 30 times a thread which will run the same method, and wanted to do this in a repeat command, for example:
for (int i = 0; i < 30; i++)
{
Thread t = new Thread(MetodoVoid);
t.Start();
System.Threading.Thread.Sleep(1000);
}
But when I wear it says thread is already running and error, how to proceed?
Read this: http://answall.com/q/1946/101 See if something more abstract doesn’t solve it better for you. There’s little reason to use it today thread raw: http://answall.com/q/77759/101 and http://answall.com/q/2793/101 See also: http://answall.com/q/86014/101 Also: http://answall.com/q/112357/101
– Maniero
This code works perfectly: https://dotnetfiddle.net/UCXSRv. Error elsewhere.
– Caffé