as know in .net 4.5 unobservedtaskexception not crash app.
to make easier developers write asynchronous code based on tasks, .net framework 4.5 changes default exception behavior unobserved exceptions. although unobserved exceptions still raise unobservedtaskexception exception, process not terminate default. instead, exception handled runtime after event raised, regardless of whether event handler observes exception. behavior can configured. starting .net framework 4.5, can use configuration element revert behavior of .net framework 4 , terminate process:
ok, assume microsoft decided change experience of multi-thread working exceptions why applied tpl then? why other parts of multi-thread mechanisms not changed? eg, following code still crash app
static void main(string[] args) { threadpool.queueuserworkitem(state => { throw new exception(); }); console.readline(); }
it's confusing , looks strange. know this?
Comments
Post a Comment