[Tutor] Connection/Analyis Order

Sean 'Shaleh' Perry shalehperry@attbi.com
Tue, 04 Jun 2002 08:33:27 -0700 (PDT)


On 04-Jun-2002 Russell Bungay wrote:
> Sean 'Shaleh' Perry wrote:
>>>I have never done any thread programming before (though Prog. Python
>>>makes it look easy enough), but I am concerned about different threads
>>>accessing the storage of the data at incompatible times and mucking it
>>>up and similar problems connecting to the mail server (I want to >>delete
>>>successfully analysed mails.)
>>The only reason to play with threads would be if you wanted to have a >mail
>>parser thread and a mail retriever thread.  Reasonable, but not a
>>>requirement.
> 
> Thats what I was thinking.  So I would only run one parser at a time?  I
> can see the advantages to this and really should of thought of it myself
>:o)  
> 

yeah the parser thread would do:

while (not blocked):
  mail = eatMailFromQueue()
  output = parse(mail)
  use output