0
$\begingroup$

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 -> Run -> 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 .

$\endgroup$
1
  • 1
    $\begingroup$ This depends on the text editor, I guess. Some use async I/O, some use threads, some use processes. Older ones probably used interrupts. $\endgroup$ – Jörg W Mittag Aug 6 '20 at 13:42
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.