[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] SOC Proposal: Networking for Pygame



Using a separate thread for networking is probably the way to go. Since sometimes the main loop could be doing lots of cpu intensive
stuff. Not leaving enough time to process the networking quickly
enough.


pygame.event.get does not wait until it gets an event.  If there are
no events it returns an empty list.


On 5/8/06, Simon Wittber <simonwittber@xxxxxxxxx> wrote:
On 5/8/06, Bob Ippolito <bob@xxxxxxxxxx> wrote:
> select.select blocks exactly no longer than you ask it to.
> pygame.event.get blocks until it gets an event. For an application
> that mostly just waits for events (mouse, keyboard) via
> pygame.event.get is not going to interoperate well with network
> events if it only polls the network after some user input. Ideally
> for those sorts of applications you would like the network to also
> send an event asynchronously to wake up the event loop. That is only
> possible with an additional thread given how SDL works.

Ah I see. It seems like a separate thread is going to be an
unfortunate necessity.

-Sw.