From: Paul Lutus Date: 2006-09-11T12:10:29+09:00 Subject: Re: state machine in ruby John Carter wrote: > First off I would just like to note a small mathematical congruence.... > > Every state machine can be replaced by a Thread. ie. Instead of a tangly > state machine, you have a thread sucking on an event queue. Let me add my 2c. Every program is a state machine. The difference between an ordinary program and what we might call a "state machine" is one of explicit expression. Also, the use of threads make the state of the state machine harder to determine. By using threads, the thread scheduler's quirks, and every other thread being run, becomes part of the behavior of a particular thread's state machine. One might go so far as to say that threads that show any interaction at all prevent a state machine from being deterministic. -- Paul Lutus http://www.arachnoid.com