Start Concurrent
492 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
492 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Multicore microprocessors are now at the heart of nearly all desktop and laptop computers. While these chips offer exciting opportunities for the creation of newer and faster applications, they also challenge students and educators. How can the new generation of computer scientists growing up with multicore chips learn to program applications that exploit this latent processing power? This unique book is an attempt to introduce concurrent programming to first-year computer science students, much earlier than most competing products.

This book assumes no programming background but offers a broad coverage of Java. It includes over 150 numbered and numerous inline examples as well as more than 300 exercises categorized as "conceptual," "programming," and "experiments." The problem-oriented approach presents a problem, explains supporting concepts, outlines necessary syntax, and finally provides its solution. All programs in the book are available for download and experimentation. A substantial index of at least 5000 entries makes it easy for readers to locate relevant information.

In a fast-changing field, this book is continually updated and refined. The 2014 version is the seventh "draft edition" of this volume, and features numerous revisions based on student feedback.

A list of errata for this version can be found on the Purdue University Department of Computer Science website.


Contents

Contents

Preface

Acknowledgements

1 Computer Basics 1

2 Problem Solving and Programming

3 Primitive Types and Strings

4 Selection

5 Repetition

6 Arrays

7 Simple Graphical User Interfaces

8 Methods

9 Classes

10 Interfaces

11 Inheritance

12 Exceptions

13 Concurrent Programming

14 Synchronization

15 Constructing Graphical User Interfaces

16 Testing and Debugging

17 Polymorphism

18 Dynamic Data Structures

19 Recursion

20 File I/O

21 Network Communication

Index

Sujets

Informations

Publié par
Date de parution 31 décembre 2013
Nombre de lectures 0
EAN13 9781626710108
Langue English
Poids de l'ouvrage 1 Mo

Informations légales : prix de location à la page 0,1500€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

© 2014 by Barry Wittman, Aditya Mathur, Tim Korb.
Distributed by Purdue University Press, http://www.thepress.purdue.edu .
Wittman          To the set of all people that I do not dedicate this book to Mathur To my mother Korb To my family
Contents
Contents
Preface
Acknowledgements
1 Computer Basics
1.1 Problem: Buying a computer
1.2 Concepts: Hardware and software
1.2.1 Hardware
1.2.2 Software
1.2.3 Examples
1.3 Syntax: Data representation
1.3.1 Compilers and interpreters
1.3.2 Numbers
1.3.3 Conversion across number systems
1.3.4 Integer representation in a computer
1.3.5 Binary arithmetic
1.3.6 Negative integers in a computer
1.3.7 Overflow and underflow
1.3.8 Bitwise operators
1.3.9 Rational numbers
1.4 Solution: Buying a computer
1.5 Concurrency: Multicore processors
1.5.1 The Good
1.5.2 The Bad
1.5.3 The Ugly
1.6 Summary
Exercises
Conceptual Problems
2 Problem Solving and Programming
2.1 Problem: How to solve problems
2.1.1 What is a program?
2.1.2 What is a programming language?
2.1.3 An example problem
2.2 Concepts: Developing software
2.2.1 Software development lifecycle
2.2.2 Acquiring a Java compiler
2.3 Syntax: Java basics
2.3.1 Java program structure
2.3.2 Command line input and output
2.3.3 GUI input and output
2.3.4 A few operations
2.3.5 Java formatting
2.4 Solution: How to solve problems
2.4.1 Bouncing ball solution (command line version)
2.4.2 Bouncing ball solution (GUI version)
2.4.3 Testing and maintenance
2.5 Concurrency: Solving problems in parallel
2.5.1 Parallelism and concurrency
2.5.2 Sequential versus concurrent programming
2.5.3 Kinds of concurrency
2.6 Summary
Exercises
Conceptual Problems
Programming Practice
3 Primitive Types and Strings
3.1 Problem: College cost calculator
3.2 Concepts: Types
3.2.1 Types as sets and operations
3.2.2 Primitive and reference types in Java
3.2.3 Type safety
3.3 Syntax: Types in Java
3.3.1 Variables and literals
3.3.2 Primitive types
3.3.3 Reference types
3.3.4 Assignment and comparison
3.3.5 Constants
3.4 Syntax: Useful libraries
3.4.1 The Math library
3.4.2 Random numbers
3.4.3 Wrapper classes
3.5 Solution: College cost calculator
3.6 Concurrency: Expressions
3.6.1 Splitting expressions
3.6.2 Care in splitting expressions
3.7 Summary
Exercises
Conceptual Problems
Programming Practice
4 Selection
4.1 Problem: Monty Hall simulation
4.2 Concepts: Choosing between options
4.2.1 Simple choices
4.2.2 Boolean operations
4.2.3 Nested choices
4.3 Syntax: Selection in Java
4.3.1 if statements
4.3.2 The boolean type and its operations
4.3.3 switch statements
4.4 Solution: Monty Hall
4.5 Concurrency: Selection
Exercises
Conceptual Problems
Programming Practice
5 Repetition
5.1 Problem: DNA searching
5.2 Concepts: Repetition
5.3 Syntax: Loops in Java
5.3.1 while loops
5.3.2 for loops
5.3.3 do-while loops
5.3.4 Nested loops
5.3.5 Common pitfalls
5.4 Solution: DNA searching
5.5 Concurrency: Loops
Exercises
Conceptual Problems
Programming Practice
Experiments
6 Arrays
6.1 Introduction
6.2 Problem: Conway’s Game of Life
6.2.1 Terminal limitations
6.3 Concepts: Lists of data
6.3.1 Data structure attributes
6.3.2 Characteristics of an array
6.4 Syntax: Arrays in Java
6.4.1 Array declaration and instantiation
6.4.2 Indexing into arrays
6.4.3 Using loops with arrays
6.4.4 Redirecting input
6.5 Examples: Array usage
6.6 Concepts: Multidimensional lists
6.7 Syntax: Advanced arrays in Java
6.7.1 Multidimensional arrays
6.7.2 Reference types
6.7.3 Ragged arrays
6.7.4 Common pitfalls
6.8 Examples: Two-dimensional arrays
6.9 Advanced Syntax: Special array tools in Java
6.9.1 The for-each loop
6.9.2 The Arrays class
6.10 Solution: Conway’s Game of Life
6.11 Concurrency: Arrays
Exercises
Conceptual Problems
Programming Practice
Experiments
7 Simple Graphical User Interfaces
7.1 Problem: Codon extractor
7.2 Concepts: User interaction
7.3 Syntax: Dialogs and the JOptionPane class
7.3.1 Generating an information dialog
7.3.2 Generating a Yes-No confirm dialog
7.3.3 Generating a dialog with a list of options
7.3.4 Generating a dialog with a custom icon
7.3.5 Generating an input dialog
7.4 Solution: Codon extractor
7.5 Concurrency: Simple GUIs
7.6 Summary
Exercises
Conceptual Problems
Programming Practice
8 Methods
8.1 Problem: Three card poker
8.2 Concepts: Dividing work into segments
8.2.1 Reasons for static methods
8.2.2 Parallel to mathematical functions
8.2.3 Control flow
8.3 Syntax: Methods
8.3.1 Defining methods
8.3.2 Calling methods
8.3.3 Class variables
8.4 Examples: Defining methods
8.5 Solution: Three card poker
8.6 Concurrency: Methods
Exercises
Conceptual Problems
Programming Practice
Experiments
9 Classes
9.1 Problem: Nested expressions
9.2 Concepts: Object-oriented programming
9.2.1 Objects
9.2.2 Encapsulation
9.2.3 Instance methods
9.3 Syntax: Classes in Java
9.3.1 Fields
9.3.2 Constructors
9.3.3 Methods
9.3.4 Access modifiers
9.4 Examples: Classes
9.5 Advanced Syntax: Nested classes
9.5.1 Static nested classes
9.5.2 Inner classes
9.6 Solution: Nested expressions
9.7 Concurrency: Objects
Exercises
Conceptual Problems
Programming Practice
Experiments
10 Interfaces
10.1 Problem: Sort it out
10.2 Concepts: Making a promise
10.3 Syntax: Interfaces
10.3.1 Interfaces and static
10.4 Advanced Syntax: Local and anonymous classes
10.4.1 Local classes
10.4.2 Anonymous classes
10.5 Solution: Sort it out
10.6 Concurrency: Interfaces
Exercises
Conceptual Problems
Programming Practice
Experiments
11 Inheritance
11.1 Problem: Boolean circuits
11.2 Concepts: Refining classes
11.2.1 Basic inheritance
11.2.2 Adding functionality
11.2.3 Code reuse
11.3 Syntax: Inheritance in Java
11.3.1 The extends keyword
11.3.2 Access restriction and visibility
11.3.3 Constructors
11.3.4 Overriding methods and hiding fields
11.3.5 The Object class
11.4 Examples: Problem solving with inheritance
11.5 Solution: Boolean circuits
11.6 Concurrency: Inheritance
Exercises
Conceptual Problems
Programming Practice
Experiments
12 Exceptions
12.1 Problem: Bank burglary
12.2 Concepts: Error handling
12.2.1 Error codes
12.2.2 Exceptions
12.3 Syntax: Exceptions in Java
12.3.1 Throwing exceptions
12.3.2 Handling exceptions
12.3.3 Catch or specify
12.3.4 The finally keyword
12.3.5 Customized exceptions
12.4 Solution: Bank burglary
12.5 Concurrency: Exceptions
12.5.1 InterruptedException
Exercises
Conceptual Problems
Programming Practice
Experiments
13 Concurrent Programming
13.1 Introduction
13.2 Problem: Deadly virus
13.3 Concepts: Splitting up work
13.3.1 Task decomposition
13.3.2 Domain decomposition
13.3.3 Tasks and threads
13.3.4 Memory architectures and concurrency
13.4 Syntax: Threads in Java
13.4.1 The Thread class
13.4.2 Creating a thread object
13.4.3 Starting a thread
13.4.4 Waiting for a thread
13.4.5 The Runnable interface
13.5 Examples: Concurrency and speedup
13.6 Concepts: Thread scheduling
13.6.1 Nondeterminism
13.6.2 Polling
13.7 Syntax: Thread states
13.8 Solution: Deadly virus
13.9 Summary
Exercises
Conceptual Problems
Programming Practice
Experiments
14 Synchronization
14.1 Introduction
14.2 Problem: Dining philosophers
14.3 Concepts: Thread interaction
14.4 Syntax: Thread synchronization
14.4.1 The synchronized keyword
14.4.2 The wait() andnotify() methods
14.5 Pitfalls: Synchronization challenges
14.5.1 Deadlock
14.5.2 Starvation and livelock
14.5.3 Sequential execution
14.5.4 Priority inversion
14.6 Solution: Dining philosophers
Exercises
Conceptual Problems
Programming Practice
Experiments
15 Constructing Graphical User Interfaces
15.1 Problem: Math applet
15.2 Concepts: Graphical user interfaces
15.2.1 Swing and AWT
15.3 Syntax: GUIs in Java
15.3.1 Creating a frame
15.3.2 Widgets
15.3.3 Adding actions to widgets
15.3.4 Adding sounds and images
15.3.5 Layout managers
15.3.6 Menus
15.3.7 Applets
15.4 Solution: Math applet
15.5 Concurrency: GUIs
15.5.1 Worker threads
15.6 Summary
Exercises
Conceptual Problems
Programming Practice
Experiments
16 Testing and Debugging
16.1 Fixing bugs
16.1.1 Common sequential bugs
16.2 Concepts: Approaches to debugging
16.2.1 Assertions
16.2.2 Print statements
16.2.3 Step-through execution
16.2.4 Breakpoints
16.3 Syntax: Java debugging tools
16.3.1 Assertions
16.3.2 Print statements
16.3.3 Step-through debugging in Java
16.3.4 Array errors
16.3.5 Scope errors
16.3.6 Null pointer errors
16.4 Concurrency: Parallel bugs
16.4.1 Race conditions
16.4.2 Deadlocks and livelocks
16.4.3 Sequential execution
16.5 Finding and avoiding bugs
16.6 Concepts: Design, implementation, and testing
16.6.1 Design
16.6.2 Implementation
16.6.3 Testing
16.7 Syntax: Java testing tools
16.7.1 JUnit testing
16.8 Concurrency: Testing tools
16.8.1 ConTest
16.8.2 Concutest
16.8.3 Intel tools
16.9 Examples: Testing a class
Exercises
Conceptual Problems
Programming Practice
Experiments
17 Polymorphism
17.1 Problem: Banking account with a vengeance
17.2 Concepts: Polymorphism
17.2.1 The is-a relationship
17.2.2 Dynamic binding
17.2.3 General vs. specific
17.3 Syntax: Inheritance tools in Java
17.3.1 Abstract classes and methods
17.3.2 Final classes and methods
17.3.3 Casting
17.3.4 Inheritance and exceptions
17.4 Solution: Banking account with a vengeance
17.5 Concurrency: Atomic libraries
Exercises
Conceptual Problems
Programming Practice
Experiments
18 Dynamic Data Structures
18.1 Problem: In

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents