Set Timeout for any method in C#
kossovsky.net
kossovsky.net
Canceling arbitrary operations is a bit of a hard problem. Automatic garbage collection helps a little, but even so, handles and locks would be left open for an indeterminate length of time.
So then why is callback not an option? After all, it is the same as setting the timeout to zero and getting interrupted (or polling) at some point in the future.