[Tutor] demon / app I/F better way ?

orbitz orbitz at ezabel.com
Sun Nov 14 18:14:48 CET 2004

What is time critical about this?  Checking a website for updates takes 
eons longer than doing some calculations.  Do you have control of both 
of these apps code? If so it might just be more efficient in the long 
run to rewrite them so that they are one application using something 
like nonblocking sockets to do multiple things.

Just a thought.

Dave S wrote:

> Kent Johnson wrote:
>> What about running the demon as a separate thread in the main app? 
>> Use a Queue to send data from the demon to the main app. The app 
>> checks for data in the queue every second.
>> Or, use a socket connection between the demon and the main app...
>> Kent
> Running the demon as a seperate thread is a good idea, I had not 
> thought of that, I was going to 'demon.py &' it - which must be pretty 
> inefficient.
> Queueing the data, like a FIFO buffer, that negates the need for  
> /data/data_flag, if its read, its gone - thats elegent -  I like that 
> :-) . I could write a script that implements a FIFO function - or 
> maybe I will find one in the vaults.
> As to using a socket, I have only encounterd passing references to 
> them mainly when tweeking the linux kernel , Can you point me in the 
> direction of how you can use them in Python ... ?
> Cheers
> Dave
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list