Skip to main content

Multithreading with Clusters

  • Chapter
  • First Online:
Pro Express.js
  • 1674 Accesses

Abstract

There are a lot of detractors out there arguing against the use of Node.js, many of which arguments are rooted in the myth that Node.js-based systems have to be single-threaded. Nothing could be further from the truth—and with the cluster module, we can effortlessly fork a Node.js process to create multiple processes. Yes, each process will still be single-threaded and be blocked by inapt synchronous code or some laborious processes (such as hashing of passwords). However, the whole system, now consisting of a few processes, won’t be blocked.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
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

Institutional subscriptions

Notes

  1. 1.

    http://nodejs.org/docs/v0.9.0/api/cluster.html#cluster_cluster_setupmaster_settings

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Azat Mardan

About this chapter

Cite this chapter

Mardan, A. (2014). Multithreading with Clusters. In: Pro Express.js. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0037-7_13

Download citation

Publish with us

Policies and ethics