Book contents
- Frontmatter
- Contents
- INTRODUCTION
- GETTING STARTED WITH JAVA
- MIGRATING TO JAVA
- TECHNIQUES 101
- MODELING AND PATTERNS
- JAVA IN A DISTRIBUTED WORLD
- THREADS
- EFFECTIVE MULTITHREADING
- MULTITHREADED ASSIGNMENT SURPRISES
- MULTITHREADED EXCEPTION HANDLING IN JAVA
- WRITING MORE COMPLEX SYNCHRONIZATION IN JAVA
- USER INTERFACES
- SECURITY
- TESTING
- PERFORMANCE
- REALITY CHECK
- INDEX
EFFECTIVE MULTITHREADING
Published online by Cambridge University Press: 06 July 2010
- Frontmatter
- Contents
- INTRODUCTION
- GETTING STARTED WITH JAVA
- MIGRATING TO JAVA
- TECHNIQUES 101
- MODELING AND PATTERNS
- JAVA IN A DISTRIBUTED WORLD
- THREADS
- EFFECTIVE MULTITHREADING
- MULTITHREADED ASSIGNMENT SURPRISES
- MULTITHREADED EXCEPTION HANDLING IN JAVA
- WRITING MORE COMPLEX SYNCHRONIZATION IN JAVA
- USER INTERFACES
- SECURITY
- TESTING
- PERFORMANCE
- REALITY CHECK
- INDEX
Summary
This is the second of a two-part series on thread separation. The first, published in Java Report's August 1998 issue, dealt with general issues and techniques for addressing them. This installment describes a simple framework to thread-separate servers from the clients that call them. This thread separation is useful if the request being served is a lengthy one, such as to retrieve an image from a large image database. The client may go on doing other things and be called back by the server when the requested task is complete. Thread separation of servers is also useful when (e.g., in a Web server), you have chosen a thread-pooling solution to limit the number of concurrent threads running in your server. All client requests are transferred to one or more controlled server threads for execution. Finally, thread separation is useful when you take advantage of the “liveness” rationale for threading, in effect, making tasks in a system “live,” because it allows them better to embody the behaviors of their real-world counterparts. Thread separation allows different components to each live and run within their own thread or threads, with control and notification between components being as brief and shallow as the designer desires.
PROBLEM DOMAIN
I recently worked on a heavyweight component model that simplified the creation of system servers. Most of the top-level components in our system were built on this model and most of these components had presentation objects that commanded them based on user actions.
- Type
- Chapter
- Information
- More Java Gems , pp. 205 - 214Publisher: Cambridge University PressPrint publication year: 2000