From: snacktime Date: 2005-10-04T17:45:35+09:00 Subject: Re: state of blocking/nonblocking I/O ------=_Part_6458_16119870.1128415530682 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > > > Josh > > > This sounds really interesting, but I don't fully understand the while > loop. Nonblocking IO sends/recieves data when its ready/requested...eg. > it doesn't block for the data, right? I have written some threaded applications. A java tic-tac-toe game which > had players and observers of a game that all viewed a global 'board' > state. Methods to modify the game state were thread safe with mutexes, > how is what your saying different...? Any info appreciated... > > ooooo my 1st post to the mailing list :) > > In simple terms, with an event framework you have one main event loop that keeps a state engine of sorts for all the current IO operations going on. I= n your code when you need to do an IO operation, you send it to the event loop, register a callback, and then when there is something to read the event loop fires the callback. Event frameworks such as python's twisted provide a lot of the internal non blocking IO functions for you so you don'= t have to implement them yourself. For example writing to a file, waiting on = a socket, etc.. You call the higher level function, register a callback, and continue on your way. Chris ------=_Part_6458_16119870.1128415530682--