27 questions for “Clustering & Worker Threads”

Found in 1 field. Select a question to see its full answer.

Information Technology

27 questions in 1 technology

#QuestionTechnologyTopicLevel
1How do you use SharedArrayBuffer to share memory directly between Node.js worker threads, and what are the safety considerations? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
2What is the os.cpus() function used for when setting up clustering in a Node.js application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsBeginner
3How do you pass data between the main thread and a worker thread using postMessage(), and what are the limits on what can be sent? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
4What is the difference between the number of CPU cores and the optimal number of cluster workers for a given Node.js application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
5What is the difference between spawning a Worker Thread and spawning a Child Process for running a CPU-intensive JavaScript function? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
6How do you gracefully terminate a worker thread, and what's the difference between worker.terminate() and letting it exit naturally? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
7What is a worker thread pool, and why would you build one rather than creating a new Worker for every task? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
8How do you handle an uncaught exception inside a specific cluster worker without taking down the entire application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
9What is the WorkerData option when creating a Worker, and how does it differ from communicating via postMessage() after creation? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
10What is the difference in behavior between the 'primary' and 'worker' role in Node's cluster module regarding which code paths execute? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced