Re: [Tutor] Threading + socket server (blocking IO)

2006-02-19 Thread Liam Clarke
Hi, Just poking at threads, I'm contemplating doing something that I think may be a very dumb thing to do, or it may work fine. In the following code - import threading import Queue import reg import msvcrt class ParseThread(threading.Thread): def __init__(self, Q, parser):

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-18 Thread Liam Clarke
Thanks Kent, I'll try swapping it around and see how it goes. As for the setDaemon, my apologies. There's a while True: if msvcrt.kbhit(): break loop afterwards, so at a keypress it exits, hence the daemon stuff. On 2/19/06, Kent Johnson [EMAIL PROTECTED] wrote: Liam Clarke

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-07 Thread Kent Johnson
Liam Clarke wrote: On 2/7/06, Kent Johnson [EMAIL PROTECTED] wrote: Liam Clarke wrote: Hi all, About to embark on my first foray into threading, and rather unsure of initial approach. I have a basic UDPServer from SocketServer running using serve_forever(). I'd like to stick this in a thread

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Kent Johnson
Liam Clarke wrote: Hi all, About to embark on my first foray into threading, and rather unsure of initial approach. I have a basic UDPServer from SocketServer running using serve_forever(). I'd like to stick this in a thread where it can endlessly loop waiting for incoming packets, and

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Kent Johnson
Liam Clarke wrote: Is this going to be possible? I've been reading about GIL and what not in the Tutor archives and this presentation here - http://starship.python.net/crew/aahz/OSCON2001/ but I'm a little unsure as to what is possible. Python has good support for multiple threads running on

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Kent Johnson
Matthew Webber wrote: The GIL prevents Python from effectively running multiple threads on multiple processors. This statement is slightly misleading. You can run multiple threads on a multi-processor system quite effectively, the limitation of the GIL is simply that you can typically

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Matthew Webber
The GIL prevents Python from effectively running multiple threads on multiple processors. This statement is slightly misleading. You can run multiple threads on a multi-processor system quite effectively, the limitation of the GIL is simply that you can typically utilize only one processor at a

Re: [Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Liam Clarke
On 2/7/06, Kent Johnson [EMAIL PROTECTED] wrote: Liam Clarke wrote: Hi all, About to embark on my first foray into threading, and rather unsure of initial approach. I have a basic UDPServer from SocketServer running using serve_forever(). I'd like to stick this in a thread where it can