Writing a small battleship game server in Python

Mike Meyer mwm at mired.org
Thu Aug 11 21:53:36 EDT 2005


Dan <dan at cellectivity.com> writes:

>> The server should accept connections from new players and be able to handle 
>> multiple games concurrently.
>
> Multiple threads would be the way to go for a real application. But if
> you want to avoid the complexity involved in threading and
> synchronization in this exercize, you can avoid threads by using
> "select" instead:

Select works quite well for real applications, without nearly the
headaches that come from using threads. The downside is that you can't
do anything that takes long amounts of real time while dealing with
the traffic. If you can live with that restriction, select is to be
preferred to multiple threads even for "real applications".

          <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list