mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-28 11:39:52 +02:00
Add content for threads in Node.js (#2246)
* Added content to prisma.md and native-drivers.md * Content added to forever.md * link updated to forever documentation * Content added to Nohup.md with links * Update content/roadmaps/107-nodejs/content/110-nodejs-databases/101-document/102-native-drivers.md * content added to threads readme.md * Content added to thread - readme.md * Content added to threads - child-pocess.md * Content added to threads - cluster.md * Content added to thread - worker-threads.md * update three node module threads typo * Update content/roadmaps/107-nodejs/content/114-nodejs-threads/readme.md Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
This commit is contained in:
@@ -1 +1,12 @@
|
||||
# Child process
|
||||
# Child Process
|
||||
|
||||
The child_process module gives the node the ability to run the child process, established through IPC (inter-process communication) by accessing operating system commands.
|
||||
|
||||
The three main methods inside this module are :
|
||||
`child_process.spawn()`
|
||||
`child_process.fork()`
|
||||
`child_process.exec()`
|
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
|
||||
|
||||
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://nodejs.org/api/child_process.html#child-process'>Child Process Docs</BadgeLink>
|
||||
|
@@ -1 +1,9 @@
|
||||
# Cluster
|
||||
# Cluster
|
||||
|
||||
The Cluster module allows you to easily create child processes that each runs simultaneously on their own single thread, to handle workloads among their application threads.
|
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
|
||||
|
||||
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://nodejs.org/api/cluster.html#cluster'>Cluster Docs</BadgeLink>
|
||||
<BadgeLink colorScheme='yellow' badgeText='Read' href='
|
||||
https://www.arubacloud.com/tutorial/how-to-use-cluster-to-increase-node-js-performance.aspx'>How Clustering Increases Performance</BadgeLink>
|
@@ -1 +1,9 @@
|
||||
# Worker threads
|
||||
# Worker Threads
|
||||
|
||||
Worker thread is a continuous parallel thread that runs and accepts messages until it is explicitly closed or terminated.
|
||||
With worker threads, we can achieve a much efficient application without creating a deadlock situation. Workers, unlike children's processes, can exchange memory.
|
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
|
||||
|
||||
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://nodejs.org/api/worker_threads.html#worker-threads'>Worker Threads Docs</BadgeLink>
|
||||
|
||||
|
@@ -1 +1,6 @@
|
||||
# Nodejs threads
|
||||
# Nodejs Threads
|
||||
|
||||
Node.js is a single-threaded language and gives us ways to work parallelly to our main process.
|
||||
Taking note of nowadays multicore system single threading is very memory efficient.
|
||||
|
||||
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://alvinlal.netlify.app/blog/single-thread-vs-child-process-vs-worker-threads-vs-cluster-in-nodejs'>Single Thread vs Child Process vs Worker Threads vs Clutster in Node.js</BadgeLink>
|
Reference in New Issue
Block a user