in Education by
I was asked below two questions in an software engineer interview but could not answer. I did goggle search but could not find answer. a. When is multi process application is better than multi thread application in a single machine? b. When is multi thread not possible in a single machine but multi process is possible? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Multi-process is better than multi-threaded when you need to isolation that processes provide to prevent tasks from interfering with each other or the controlling process. This can mean, for example: You want to be able to terminate tasks abruptly. If they are processes, then the OS will ensure that their system resources are released; or You just want to be sure that a task's resources are freed when it completes, even if it completes normally; or You have a (non-adversarial) multi-tenant system; or You want to be sure that tasks do not inadvertently share memory, etc. I'm not sure what the asker wants w.r.t. multi-threading being "impossible", but maybe he is thinking of one of the above scenarios, or just when you're using a host environment like NodeJS that doesn't allow multi-threading.

Related questions

0 votes
    I would like to call a .net 4.0 dll from an IIS7 application that is running in a .net 2.0 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    what happens to cell content when multi cells are marged to from a single cell? Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    what happens to cell content when multi cells are marged to from a single cell? Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    In a single application, we can spy via more than one spying mode a)False b)True...
asked Dec 11, 2020 in Education by Editorial Staff
0 votes
    Having two thread, one product data, another one process data. The data is not just an int or float but a complex object. In ... = buffer; //mutex.unlock(); if(!tmp.data) std::cout...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    In a multi user multi-threaded environment, thread safety is important as one may erroneously gain access to another ... (1)OS commands (2)Race conditions (3)Session Integrity...
asked May 17, 2021 in Technology by JackTerrance
0 votes
    What are the benefits of a single-threaded web backend to a multi-threaded one?...
asked Jan 25, 2021 in Technology by JackTerrance
0 votes
    Which of the following have computers traditionally done better than people? (a) storing information (b) ... information & computing numerically Please answer the above question....
asked Oct 6, 2022 in Education by JackTerrance
0 votes
    Which of the following have computers traditionally done better than people? (a) storing information (b) ... information & computing numerically Please answer the above question....
asked Oct 2, 2022 in Education by JackTerrance
0 votes
    Which of the following have computers traditionally done better than people? (a) storing information (b) ... information & computing numerically Please answer the above question....
asked Sep 23, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me why Python is better than R for Data Science? Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    Is our society better than it would have been without the computer revolution? Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Why is the replace() method better than the assign() method? (a) Reliable (b) Highly manageable ( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What are the Continuous Integration tools, and why is Jenkins better than them?...
asked Oct 1, 2021 in Technology by JackTerrance
0 votes
    Kafka also provides better ordering guarantees than a traditional messaging system using ________. (1)Streams API (2)counters (3)round robin (4)topic partitions....
asked Jun 16, 2021 in Technology by JackTerrance
...