I'm working on a desktop app using Electron.js for the frontend and Java for the backend. Instead of setting up endpoints and using REST APIs for communication, I want to directly run my Java application using Node.js child_process
.
I know Node.js is single-threaded, but I need my Java application to run with its full multi-threading capabilities within a Node.js child process.
Is it possible to run a multi-threaded Java application using Node.js child_process
? How can I ensure my Java application retains its multi-threading capabilities when run from a Node.js child process?
A child process is a separate process spawned by the operating system that doesn't share any threading characteristics of its parent process. Even the language and runtime may be completely different, as with any process that you execute in your operating system.