Single threaded and single process solution is normal practice. For example, if you open the text editor, it will start a single threaded process. For each file, it will start a new text editor instance. This works well.
In a typical scenario, for high performance and scalable solution, designer needs to use multiple threads which runs on multi-core cpu in parallel. For example, consider online shopping website. The load on http web process depends on number of people accessing the site. To provide better throughput and response time, designer of such site must consider parallelism of operation.
Choice between multithreading and multi-process depends on the problem at hand. In case parallelism is needed and the parallel running entity are related in terms of data, then multithreading can be the first choice of evaluation. We can even consider hybrid model. Below there are few interesting use-cases.
Use-case1
If we design a http web process, a designated master thread can handle http connection. Multiple worker thread can serve the http request. Note that in this case,
http request data is shared between master thread and worker thread
Worker thread is not memory hungry.
Use-case2
In this use-case, programmer needs to collect info from various sources and then store these info to database.
Here there are two components:
Collectors which fetches info from various sources
Database manager which stores data
For collector, multiple processes makes more sense. I am telling this since
It allows horizontal scalability. Note that multiple collectors can separately run in different machines and communicate with the database to write the data.
Collectors runs periodically and so, there can be async single threaded implementation which makes high performance code which is simple to maintain
For database management, single process with multiple threads makes more sense since
It avoid inter process lock to access database.
database manager needs to provide better response time and so, it needs to use multiple threads.
http://stackoverflow.com/questions/5440128/thread-context-switch-vs-process-context-switch
http://stackoverflow.com/questions/3044580/multiprocessing-vs-threading-python
http://blogs.datalogics.com/2013/09/25/threads-vs-processes-for-program-parallelization/