Capriccio- Scalable Threads for Internet Service.ppt
《Capriccio- Scalable Threads for Internet Service.ppt》由会员分享,可在线阅读,更多相关《Capriccio- Scalable Threads for Internet Service.ppt(46页珍藏版)》请在麦多课文档分享上搜索。
1、Capriccio: Scalable Threads for Internet Service,Introduction,Internet services have ever-increasing scalability demands Current hardware is meeting these demands Software has lagged behind Recent approaches are event-based Pipeline stages of events,Drawbacks of Events,Events systems hide the contro
2、l flow Difficult to understand and debug Eventually evolved into call-and-return event pairs Programmers need to match related events Need to save/restore states Capriccio: instead of event-based model, fix the thread-based model,Goals of Capriccio,Support for existing thread API Little changes to e
3、xisting applications Scalability to thousands of threads One thread per execution Flexibility to address application-specific needs,Performance,Ease of Programming,Threads,Threads,Events,Ideal,Thread Design Principles,Kernel-level threads are for true concurrency User-level threads provide a clean p
4、rogramming model with useful invariants and semantics Decouple user from kernel level threads More portable,Capriccio,Thread package All thread operations are O(1) Linked stacks Address the problem of stack allocation for large numbers of threads Combination of compile-time and run-time analysis Res
5、ource-aware scheduler,Thread Design and Scalability,POSIX API Backward compatible,User-Level Threads,+ Performance + Flexibility - Complex preemption - Bad interaction with kernel scheduler,Flexibility,Decoupling user and kernel threads allows faster innovation Can use new kernel thread features wit
6、hout changing application code Scheduler tailored for applications Lightweight,Performance,Reduce the overhead of thread synchronization No kernel crossing for preemptive threading More efficient memory management at user level,Disadvantages,Need to replace blocking calls with nonblocking ones to ho
7、ld the CPU Translation overhead Problems with multiple processors Synchronization becomes more expensive,Context Switches,Built on top of Edgar Toernigs coroutine library Fast context switches when threads voluntarily yield,I/O,Capriccio intercepts blocking I/O calls Uses epoll for asynchronous I/O,
8、Scheduling,Very much like an event-driven application Events are hidden from programmers,Synchronization,Supports cooperative threading on single-CPU machines Requires only Boolean checks,Threading Microbenchmarks,SMP, two 2.4 GHz Xeon processors 1 GB memory two 10 K RPM SCSI Ultra II hard drives Li
9、nux 2.5.70 Compared Capriccio, LinuxThreads, and Native POSIX Threads for Linux,Latencies of Thread Primitives,Thread Scalability,Producer-consumer microbenchmark LinuxThreads begin to degrade after 20 threads NPTL degrades after 100 Capriccio scales to 32K producers and consumers (64K threads total
10、),Thread Scalability,I/O Performance,Network performance Token passing among pipes Simulates the effect of slow client links 10% overhead compared to epoll Twice as fast as both LinuxThreads and NPTL when more than 1000 threads Disk I/O comparable to kernel threads,Linked Stack Management,LinuxThrea
11、ds allocates 2MB per stack 1 GB of VM holds only 500 threads,Fixed Stacks,Linked Stack Management,But most threads consumes only a few KB of stack space at a given time Dynamic stack allocation can significantly reduce the size of VM,Linked Stack,Compiler Analysis and Linked Stacks,Whole-program ana
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CAPRICCIOSCALABLETHREADSFORINTERNETSERVICEPPT

链接地址:http://www.mydoc123.com/p-379310.html