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>pull/2163/head^2
parent
da09b4fa3e
commit
1596822d44
4 changed files with 36 additions and 4 deletions
@ -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> |
Loading…
Reference in new issue