Context switch in an Text Editor I am new to operating systems and have been wondering about this.
Consider a normal text editor, and it's process running in the CPU. Since text editors include IO operations, do the process keep switching it's state from Wait -&gt; Run -&gt; Wait etc. While the user is typing and the same is reflected on the screen or some processing such as auto-correct etc. And while the current process is in Wait, other process is in Run state (Context Switching).
OR
Text - Editor itself creates multiple processes, one for handling IO operation and other for processing the data and it is being established through Inter-Process Communication.
New to OS and stuck with this, thank you for any kind of help .
There is no single answer: you could build a text editor in any way you want.
One simple architecture for a text editor is to have a single process, which blocks on I/O when it is waiting for the user to provide input.  But it's also possible for a text editor to be built in a multi-threaded way with multiple processes, e.g., spawning one thread to do spellchecking in the background or anything else.