Multiprocessor Support for Event-Driven Programs

This paper presents a new asynchronous programming library (libasync-smp) that allows event-driven applications to take advantage of multiprocessors by running code for event handlers in parallel. To control the concurrency between events, the programmer can specify a color for each event: events with the same color (the default case) are handled serially; events with different colors can be handled in parallel. The programmer can incrementally expose parallelism in existing event-driven applications by assigning different colors to computationally-intensive events that do not share mutable state. An evaluation of libasync-smp demonstrates that applications achieve multiprocessor speedup with little programming effort. As an example, parallelizing the cryptography in the SFS file server required about 90 lines of changed code in two modules, out of a total of about 12,000 lines. Multiple clients were able to read large cached files from the libasync-smp SFS server running on a 4-CPU machine 2.5 times as fast as from an unmodified uniprocessor SFS server on one CPU. Applications without computationally intensive tasks also benefit: an event-driven Web server achieves 1.5 speedup on four CPUs with multiple clients reading small cached files.

[1]  Robert Morris,et al.  Chord: A scalable peer-to-peer lookup service for internet applications , 2001, SIGCOMM 2001.

[2]  James R. Larus,et al.  Using Cohort-Scheduling to Enhance Server Performance , 2002, USENIX Annual Technical Conference, General Track.

[3]  David Mazières,et al.  A Toolkit for User-Level File Systems , 2001, USENIX Annual Technical Conference, General Track.

[4]  Brian N. Bershad,et al.  Using continuations to implement thread management and communication in operating systems , 1991, SOSP '91.

[5]  赵阳,et al.  在Apache Web Server上实现用户认证 , 2002 .

[6]  David Mazières,et al.  Separating key management from file system security , 1999, SOSP.

[7]  Willy Zwaenepoel,et al.  An Efficient and Portable Web Server , 1999 .

[8]  David E. Culler,et al.  SEDA: an architecture for well-conditioned, scalable internet services , 2001, SOSP.

[9]  David R. Karger,et al.  Wide-area cooperative storage with CFS , 2001, SOSP.

[10]  Roger M. Needham,et al.  On the duality of operating system structures , 1979, OPSR.

[11]  Gerald Jay Sussman,et al.  Lambda: The Ultimate Imperative , 1976 .

[12]  Mike Hibler,et al.  Interface and execution models in the Fluke kernel , 1999, OSDI '99.

[13]  Willy Zwaenepoel,et al.  Flash: An efficient and portable Web server , 1999, USENIX Annual Technical Conference, General Track.

[14]  Jim Gray,et al.  The convoy phenomenon , 1979, OPSR.

[15]  Andrew D. Birrell,et al.  An Introduction to Programming with Threads , 1996 .

[16]  David Mazières,et al.  Fast and secure distributed read-only file system , 2000, TOCS.

[17]  Brian N. Bershad,et al.  Scheduler activations: effective kernel support for the user-level management of parallelism , 1991, TOCS.

[18]  F. Warren Burton,et al.  Executing functional programs on a virtual tree of processors , 1981, FPCA '81.

[19]  Steven Bauer,et al.  Proceedings of the 2002 Usenix Annual Technical Conference Simple and General Statistical Profiling with Pct , 2022 .

[20]  Daniel Pierre Bovet,et al.  Understanding the Linux Kernel , 2000 .

[21]  David R. Karger,et al.  Chord: A scalable peer-to-peer lookup service for internet applications , 2001, SIGCOMM '01.

[22]  Kevin J. Dunlap,et al.  Experiences Implementing BIND, a Distributed Name Server for the DARPA Internet , 1986, USENIX Summer.

[23]  John R. Douceur,et al.  Cooperative Task Management without Manual Stack Management or, Event-driven Programming is Not the Opposite of Threaded Programming , 2002 .