[Twisted-Python] shared list in factory, mutexes?

Andrew Bennetts andrew-twisted at puzzling.org
Tue Apr 15 06:38:27 EDT 2008


Gabriel Rossetti wrote:
[...]
> Yes Andrew, thanks! So keeps a list of all connections around and does  
> something with them when there is something to be done. So if I have a  
> shared list, only one connection actually access it at a time, thus  
> mutexes don't need to be used, but if something needs to be atomic, like  
> one message depending on the answer of another, I would use deferred  
> objects, If I need to to some heavy I/O (other than network) or lengthy  
> processing I would use a thread that returns a deferred, correct? So  
> like in code that calls an external program and I need to do something  
> when it is done, I would use twisted.internet.utils.getProcessValue(),  
> get a deferred and add a callback to do whatever I need to do when it is  
> done. Ok, I get it better now :-)

Yep, it looks like you've got it :)

-Andrew.





More information about the Twisted-Python mailing list