Max Execution Time on Thread
Collapse
This topic is closed.
X
X
Collapse
-
Dan MangesDan Manges
Max Execution Time on Thread
How can I set the max execution time on a thread? I would like to throw
an exception or indicate a failure if a thread runs longer than x seconds.
Thanks,
Dan Manges
-
Peter Bromberg [C# MVP]Peter Bromberg [C# MVP]
RE: Max Execution Time on Thread
Dan,
You can use the WaitHandle.Wait One overload that takes a timespan /
milliseconds parameter as a simplified thread / method execution timeout
mechanism.
--
Co-founder, Eggheadcafe.com developer portal:
UnBlog:
"Dan Manges" wrote:
[color=blue]
> How can I set the max execution time on a thread? I would like to throw
> an exception or indicate a failure if a thread runs longer than x seconds.
>
> Thanks,
>
> Dan Manges
>[/color]
Comment
-
Dan MangesDan Manges
Re: Max Execution Time on Thread
Peter Bromberg [C# MVP] wrote:[color=blue]
> Dan,
> You can use the WaitHandle.Wait One overload that takes a timespan /
> milliseconds parameter as a simplified thread / method execution timeout
> mechanism.
>
> http://msdn2.microsoft.com/en-us/library/85bbbxt9.aspx
>[/color]
Peter,
That worked perfectly. Thanks!
Dan Manges
Comment