Soy nuevo en el subprocesamiento en C#. ¿Hay alguna forma de establecer un tiempo de espera para un hilo sin bloquear el hilo de llamada (en C# 3.5)?Tiempo de espera del subproceso en C#
Si no es así, ¿es lógico ejecutar una función usando un hilo y dentro de esa función crear un hilo y unirlo para superar este problema principal de bloqueo de hilo? Para ilustrar:
En lugar de:
Public void main()
{
...
Thread thrd1 = new Thread(new ThreadStart(targetObj.targetFunc));
thrd1.Start();
thrd1.Join();
...
}
usando algo como:
Public void main()
{
...
Thread thrd1 = new Thread(new ThreadStart(middleObj.waiter));
thrd1.Start();
...
}
//And in the middleObj.waiter():
Public void waiter()
{
Thread thrd2 = new Thread(new ThreadStart(targetObj.targetFunc));
thrd2.Start();
thrd2.Join();
}
Similar http://stackoverflow.com/questions/299198/implement-c-sharp-generic-timeout – Kiquenet