摘要: 在 .Net 开发中, 使用 Task 、 Task 进行异步编程是非常方便的, 但是在处理 Task 产生的异常时, 需要注意一个问题, 比如下面的代码:?123456789101112staticTask TestAsync(inta, intb) {var tcs = newTaskCompletionSource();Task.Factory.StartNew(() => {if(a + b {if(task.IsFaulted) {Console.WriteLine(task.Exception.GetBaseException());}else{Console.WriteLi 阅读全文
posted @ 2013-09-07 11:55 赤狐(zcm123) 阅读(432) 评论(0) 推荐(0) 编辑
摘要: http://beyondrelational.com/modules/2/blogs/79/posts/11524/task-cancellation-parallel-programming-iii.aspxThis is my third article on Parallel programming. Last two articles are on Data Parallelism and Task Parallelism.You can read my previous article here:Begin with Parallel programming in Dotnet 4 阅读全文
posted @ 2013-09-07 11:28 赤狐(zcm123) 阅读(357) 评论(0) 推荐(0) 编辑