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): self.

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 wro

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

2006-02-18 Thread Kent Johnson
Liam Clarke wrote: > Hi, > > Just coming back to the server end of things. Kent, could I please ask > you to confirm that I'm not doing anything abnormal with the > ThreadingMixIn? The code is here at rafb: > http://www.rafb.net/paste/results/915JVm90.html > > Basically, when I test it using a sc

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

2006-02-17 Thread Liam Clarke
Hi, Just coming back to the server end of things. Kent, could I please ask you to confirm that I'm not doing anything abnormal with the ThreadingMixIn? The code is here at rafb: http://www.rafb.net/paste/results/915JVm90.html Basically, when I test it using a script to generate the datagrams via

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 s

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 w

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

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 typic

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

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

[Tutor] Threading + socket server (blocking IO)

2006-02-06 Thread Liam Clarke
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 pushing the received data into