Skip to main content

Threads in an Object-Oriented World

  • Chapter
  • 234 Accesses

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

eBook
USD   24.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   34.95
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics