Detecting a hung command
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi All, I have a for loop in which I run a non-Matlab command... specifically, "findscu" which is part of the dicom toolkit:
for i=1:n
unix(['findscu ...'])
end
Unfortunately, this command hangs once in a while, sometimes a day later and sometimes a few hours. I have to constantly check to see if I need to ctrl-C and restart my code. Importantly, Matlab does not crash, rather, the findscu code just gets stuck searching indefinitely and does not progress to the next iteration of the loop. Can anyone think of a way in which I might be able to have a timeout such that I can force my code to error out after a certain time so that I can automatically go to the next iteration of the loop? thanks!
0 comentarios
Respuestas (1)
Walter Roberson
el 11 de Mayo de 2016
If it is using CPU time then you could also use "ulimit -t"
0 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!