using threads with python and winnt

Matthew Miller matthewm at zebrasoft.co.nz
Tue Jan 25 02:49:02 EST 2000


Hi Guy,

Maybe in the heat of the moment I was overly glib about Win9x and python
threading. To start with, I almost never use Win9x which is certainly not the
ideal starting point for assessing its threading capability/coupling with
python. The project was helping our local high school implement a teaching aid
to help students understand the inner workings of tcp/ip. The idea was that
students create a text-file like:-
# Connect to an SMTP server and send a basic message
/r smtp.foobar.com:25
/r helo matthew
/r mail from: matthew at matthew.com
/r rcpt to: matthew at matthew.com
/r data
.
/r quit

and submit it to a 'Protocol SERVER' (listeneing on a tcp port - eg: 12345)
which would then dispatch the contents to either a real or simulated tcp service
(ftp:21, pop:110, etc) for processing. the /r tag meant to wait for a server
response. The Protocol Server was fully threaded, and the client apps started a
new thread for each file (or stdin keystrokes) sent. Win95 was used on all
machines. Ultimately a response file was sent back to each students home
directory to see how they did, and sometimes (depending on protocol, etc) would
get a real world result like their actual e-mail. Anyway, to cut a long story
short, I gave up and implemented the project in Java (SORRY!). As I said, I'm no
expert in Win95 or Python, but I found the Win95 server 'behaviour' of
locking-up (requiring a hard reboot) just too hard on the nerves. I don't know
whether it's Win95's tcp/ip architecture (which I'm told is not so robust), ME!
or the threading/loading factor. A no-frills server and client was developed
under NT using Python and seemed to work fine, but when the same program was run
under Win95, the protocol server coped for an arbitrary amount of time and then
it didn't. Hopefully you get the gist of what the project was about. The only
comment I can make is that Win95, lots of threads and lots of socket activity
didn't work for me. Can't say that Java would have been different under Win95.
In the meantime, the PC running the Protocol Server was upped to NT (and I'm
hoping will finally make the final evolutionary step to Linux sometime soon),
and the Java stuff works great. Maybe I'll revisit this as a Python project in
the future. To conclude:- NT/Python gets the thumbs up, Python/Win95gets the
thumbs down.

HTH, Matthew.

"Guy L. Oliver" wrote:

> Any more details?  I've been using threading package under 98, 95, nt,
> linux, and solaris with no problems.  Also, the semaphores, conditions,
> queue, etc.  ive never had any problems (thread pool based web server
> experiment, with python generated dynamic content)
>
> Id be very interested to hear of any problems you had so I can watch out for
> them.
>
> glo
>
> "Matthew Miller" <matthewm at zebrasoft.co.nz> wrote in message
> news:388C1CE3.3391A5CF at zebrasoft.co.nz...
> > Be afraid, be very afraid! Seriously though, I head-banged with threading
> > under Win98 and eventually gave up. The app though works perfectly under
> > WinNT. Unless it is REALLY neccessary to support Win9x, spare yourself
> from
> > the pain. matthew.
> >
> > Sean Mc Grath wrote:
> >
> > > >Kreiner Karl or Charly or somebody wrote:
> > > >
> > > >>             does anyone have expiriences with using threads and winnt
> ?
> > > [...]
> > > <gmcm at hypernet.com> wrote:
> > > >Threads work dandy on NT
> > > [...]
> > >
> > > Does anybody know how good/bad/indifferent the threading stuff works
> > > on Windows 95/98? I am considering using threads for an app
> > > under development but I'm a bit worried (read "terrified") about
> > > the issues that might pop up in '95 and '98.
> > >
> > > regards,
> > > Sean McGrath
> > >
> >
> > --
> > Matthew Miller
> > Zebra Software Ltd.
> >
> > E-mail: matthewm at zebrasoft.co.nz
> > Ph: 025-2920625 / FAX: 03-3842397
> >
> >

--
Matthew Miller
Zebra Software Ltd.

E-mail: matthewm at zebrasoft.co.nz
Ph: 025-2920625 / FAX: 03-3842397





More information about the Python-list mailing list