没有合适的资源?快使用搜索试试~ 我知道了~
Async in C# 5.0.pdf
5星 · 超过95%的资源 需积分: 10 58 下载量 106 浏览量
2012-11-30
14:10:48
上传
评论
收藏 3.97MB PDF 举报
温馨提示
试读
106页
Async in C# 5.0.pdf .net framework 4.5 喜欢新技术的不要错过
资源推荐
资源详情
资源评论
Async in C# 5.0
Alex Davies
Beijing
•
Cambridge
•
Farnham
•
Köln
•
Sebastopol
•
Tokyo
Async in C# 5.0
by Alex Davies
Copyright © 2012 Alex Davies. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editor: Rachel Roumeliotis
Production Editor: Rachel Steely
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrators: Robert Romano and Rebecca Demarest
Revision History for the First Edition:
2012-09-07 First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449337162 for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. Async in C# 5.0, the image of a palm cockatoo, and related trade dress are trade-
marks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.
ISBN: 978-1-449-33716-2
[LSI]
1347041364
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Asynchronous Programming 1
What’s So Great About Asynchronous Code? 2
What Is Async? 2
What Async Does 3
Async Doesn’t Solve Everything 4
2. Why Programs Need to Be Asynchronous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Desktop User Interface Applications 5
An Analogy: The Cafe 6
Web Application Server Code 7
Another Analogy: The Restaurant Kitchen 8
Silverlight, Windows Phone, and Windows 8 9
Parallel Code 9
An Example 10
3. Writing Asynchronous Code Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Some Asynchronous Patterns Used in .NET 13
The Simplest Asynchronous Pattern 14
An Introduction to Task 15
The Problem with Manual Asynchrony 16
Converting the Example to Use Manual Asynchronous Code 17
4. Writing Async Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Converting the Favicon Example to Async 19
Task and await 20
Async Method Return Types 21
Async, Method Signatures, and Interfaces 22
The return Statement in Async Methods 23
iii
剩余105页未读,继续阅读
资源评论
- 股月2014-05-12讲的挺不错的,看完发现对当前的项目没有什么作用。
- liu_sl20052018-08-13先下载下来看看!
- union-union2015-07-22内容不错,也比较清晰
- 猫头燕2014-03-08找了很久,可看,谢谢。
liuys00
- 粉丝: 3
- 资源: 25
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功