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

Dave S pythontut at pusspaws.net
Sun Nov 14 16:47:59 CET 2004


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





More information about the Tutor mailing list