• Complain

Philipp Haller - Actors in Scala

Here you can read online Philipp Haller - Actors in Scala full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2012, publisher: Artima, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Philipp Haller Actors in Scala

Actors in Scala: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Actors in Scala" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Recent trends in computer architecture make concurrency and parallelism an essential ingredient of efficient program execution. The actor model of concurrency allows you to express real-world concurrency in a natural way using concurrent processes that communicate via asynchronous messages. Scala is a programming language for the Java virtual machine, providing excellent support for both object-oriented and functional programming. By including a powerful actor framework in its standard library, Scala offers a compelling approach to tackle concurrent programming. Scalas actors let you apply the actor concurrency model to the JVM, enabling real-world solutions that are efficient, scalable, and robust. Published by Artima, this is the first book on Scalas actors, co-authored by the creator and lead maintainer, Philipp Haller, and Frank Sommers. Starting with the fundamentals of the actor concurrency model, this book offers a comprehensive tutorial on practical programming with actors in Scala. It enables you to leverage the full power of todays and tomorrows multi-core processors by describing both basic and advanced features of Scalas actor framework in-depth.

Philipp Haller: author's other books


Who wrote Actors in Scala? Find out the surname, the name of the author of the book and a list of all author's works by series.

Actors in Scala — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Actors in Scala" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Actors in Scala Philipp Haller, Frank Sommers

Picture 1
Artima Press
Walnut Creek, California

Actors in Scala

Philipp Haller is a post-doctoral researcher at Stanford University, USA,and EPFL, Switzerland.Frank Sommers is president of Autospaces, Inc.

Artima Press is an imprint of Artima, Inc.
P.O. Box 305, Walnut Creek, California 94597

Copyright 2010-2011 Philipp Haller and Frank Sommers. All rights reserved.

PrePrint Edition first published 2010
First edition published 2011
Build date of this impression December 23, 2011

Produced in the United States of America

No part of this publication may be reproduced, modified, distributed,stored in a retrieval system, republished, displayed, or performed, forcommercial or noncommercial purposes or for compensation of any kind without prior written permission from Artima, Inc.


All information and materials in this book are provided "as is" and without warranty of any kind.


The term "Artima" and the Artima logo are trademarks or registered trademarks of Artima, Inc. All other company and/or product namesmay be trademarks or registered trademarks of their owners.

to my parents, Gudrun and Rudolf - P.H.
to Jungwon - F.S.
Table of Contents

Foreword

I have been fascinated by concurrency and distributed computing for as long as I can remember. I stillremember the joy of solving the classic dining philosophers problem using my own semaphore library builton top of the pthreads C library back in university many years ago. A few years later a new language calledJava came along. Java made a lot of things easier for us developers; it had, for example, automatic memorymanagement and a rich standard library. It also came with a single unified abstraction over threads and hadconcurrency utilities built into the language (for example, wait , notify , and synchronized ), which was later expandedwith the rich java.util.concurrent library. I embraced Java as my primary language of choice. The problemwas that writing concurrent programs still needed too much low-level plumbing and was still way too hard. Themain reason for this was that Java blindly adopted the C/C++ concurrency paradigm; shared-state concurrency,e.g., concurrent access to shared mutable state, which in most cases is not what you need and therefore the wrong default.

Over the years I have done my share of programming with threads and locks, spending late nights and weekends atthe office tracking down concurrency bugs. One day I just had enough. I started reading up on alternativeconcurrency paradigms, in particular message-passing concurrency as implemented by the language and runtime Erlang,and dataflow concurrency from an esoteric academic language called Oz. I was amazed by both of these languages andtheir approach to concurrency; in particular, Erlang and its actor-based programming model. Actors raised the abstractionlevel from threads and locks and made it so much easier to write, understand, and maintain my concurrent code. Insteadof spending time getting the plumbing right, I could focus on the workflowhow the messages flowed in the systemwhichmade my code so much easier to understand and maintain. So I fell in love with Erlang and its actors. Actors also turnedout to be great not only for concurrency but also for fault tolerance and distributed computing. I had finally found atool that I could use to scale up, utilizing symmetric multiprocessor (SMP)/multicore machines, scale out on the cluster, and write highlyavailable systems. Life was good.

About five years ago I discovered and fell in love with Scala. In Scala, I found a fascinating language that blendedobject-oriented and functional programming with rare elegance, ran on the JVM, was statically typed with the sameperformance as Java, and...had actors. It couldn't be better. All the goodness of Erlang on the JVM. I startedusing Scala and Scala's actors as my main language and tool set for writing scalable, fault-tolerant, and highlyconcurrent systems. This eventually led me to create Akka, an actor runtime that builds upon the Scala foundationby adding even richer tools for concurrency and distributed computing.

I have a lot to thank Philipp Haller, one of the two authors of this book and the creator of Scala actors. Withouthis excellent work I would probably not have started using Scala and would not have created Akka. I would have missedout on a lot of fun. I am really glad that Philipp and Frank have taken the time to write this book. Now we finallyhave an introductory book that teaches how to use actors in Scala and that covers both Scala's actors library as wellas Akka. It is a great first step into the wonderful world of actors. See reading this book as an investment: it will help you to write correct, performant, scalable, and available systems in less time, giving more time to more important things in life.

Jonas Bonr
CTO Typesafe
Uppsala, Sweden
November 1, 2011

Acknowledgments

There are many people who have shaped this book in differentways. First and foremost, we'd like to thank Tom Van Cutsemfor contributing large parts of ("Distributed and ParallelComputing"); at least half of the material on MapReduce wascontributed by him. In the same chapter, the solutions for best-effortand reliable broadcast are based on code contributed by AleksandarProkopec.

We are grateful to Kunle Olukotun and Martin Odersky for supportingPhilipp's work on this book in 2011, while being a post-doctoralresearch fellow at Stanford University, USA, and at colePolytechnique Fdrale de Lausanne (EPFL), Switzerland.

We'd also like to thank Stphane Micheloud, Samira Tasharofi, MircoDotta, and Vojin Jovanovic, for reviewing earlier versions andpreprints of this book. Their feedback has helped us improve the textin countless places.

Special thanks go to Bill Venners who initially came up with the ideaof a book on Scala actors. Without his expertise in publishingand his continuous support over many months, this book would not havebeen possible.

Introduction

This book is a tutorial for programming with actors in the Scalaprogramming language. Actors provide a high-level programming modelfor concurrent and distributed systems based on lightweight processesand message passing. One of the authors of this book, Philipp Haller,is the creator of Scala's actors library, and is directly involved inthe development of actors in Scala's standard library. Our goal isthat by reading this book, you can learn everything you need to buildefficient, scalable, and robust concurrent software for the JVM,productively, using actors. All examples in this book compile withScala version 2.9.1 and Akka version 1.2.

Who should read this book

The main target audience of this book is programmers who want to learnhow to program using actors in Scala. If you are interested inbuilding highly concurrent, scalable systems in Scala, then this bookintroduces you to Scala's main offering in this space, actors. Thisbook provides an introduction both to actors in Scala's standardlibrary, as well as to Akka's actors, which enable even more powerfulfacilities for fault-tolerant event-driven middleware solutions.

In addition, students and programmers who would like to expand theirknowledge of concurrent and distributed programming by learning abouta not-yet-standard concurrency paradigm should find this bookinteresting. As a Java programmer, for example, you might be used toprogramming with threads, synchronized methods, volatile fields, andso on. Learning about actors, and the underlying approach to modelingconcurrent systems, can help you think about concurrency differently,thereby broadening your horizons.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Actors in Scala»

Look at similar books to Actors in Scala. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Actors in Scala»

Discussion, reviews of the book Actors in Scala and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.