Alan Cox once said A Computer is a state machine. Threads are for people who can't program state machines.Since asking Alan directly is not an option for humble me, I'd rather ask here:  how does one achieve multi-threading functionality in high-level language, such as Java, using only one thread and state machine? For example, what if there are 2 activities to perform (doing calculations and doing I/O) and one activity can block?Is using state-machine only way viable alternative to multi-threading in high-level languages?
State machines vs threads
multithreading;finite state machine