Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Programming in Scala > Chapter 32: Actors and Concurrency - Pg. 691

Chapter 32 Actors and Concurrency Sometimes it helps in designing a program to specify that things happen independently, in parallel, concurrently. Java includes support for concur- rency, and although this support is sufficient, it turns out to be quite difficult to get right in practice as programs get larger and more complex. Scala aug- ments Java's native support by adding actors. Actors provide a concurrency model that is easier to work with and can, therefore, help you avoid many of the difficulties of using Java's native concurrency model. This chapter will show you the basics of how to use Scala's actors library and provide an ex- tended example that transforms the single-threaded circuit simulation code of Chapter 18 into a multi-threaded version. 32.1 Trouble in paradise