Abstract
In the previous chapters, I’ve looked at low-level solutions to threading problems: locks of various sorts, timers, and so forth. This chapter moves on to discuss architectural solutions to threading problems. We’ll look at threads from the perspective of an OO designer, and at how to implement threads in an OO environment, focusing on the implementation of asynchronous methods. Along the way, I’ll look at another design pattern: Command—a means of implementing function pointers in an object-oriented way. I’ll also look at an architectural-level solution to the threading-complexity problem: namely the thread pool, which is useful for minimizing thread-creation overhead. Finally, I’ll demonstrate the practical application of a thread pool by showing you how to implement a server-side socket’s “accept” loop efficiently.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2000 Allen I. Holub
About this chapter
Cite this chapter
Holub, A. (2000). Threads in an Object-Oriented World. In: Taming Java Threads. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-1129-7_8
Download citation
DOI: https://doi.org/10.1007/978-1-4302-1129-7_8
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-893115-10-1
Online ISBN: 978-1-4302-1129-7
eBook Packages: Springer Book Archive