[Twisted-Python] Threaded Twisted?

Hi! I wondered what would be the best way of running Twisted on a multi-processor system. I can run multiple instances of my program, but the message passing between them becomes somewhat more expensive than I would like (serialization). Can Twisted run in multiple Threads? Meaning: use two concurrent reactors? As far as I understand it, the reactor is implemented as a singleton, but since different reactor types are already supported, I wonder if anyone could think of a way of achieving that... Any ideas? Stefan

On Oct 20, 2004, at 6:00, Stefan Behnel wrote:
I wondered what would be the best way of running Twisted on a multi-processor system.
Multiple processors, multiple processes. Multiple processes is a good model anyways because it scales to clusters of machines.
It's probably not as expensive as having a Global Interpreter Lock (GIL) that prevents multiple threads from running Python code at the same time, diluting any benefits you would see from concurrent reactors.
No it can not use two reactors. Even if it could, you wouldn't get much better performance due to the GIL. -bob

Bob Ippolito schrieb:
Multiple processors, multiple processes. Multiple processes is a good model anyways because it scales to clusters of machines.
True. That's actually a current side effect of my program.
Sure, the GIL. I read about it when I started using Python, but I must have forgotten it. I guess you're right, multiple processes is simple to do and it does even have some advantages here. Thanks, Stefan

On Oct 20, 2004, at 6:00, Stefan Behnel wrote:
I wondered what would be the best way of running Twisted on a multi-processor system.
Multiple processors, multiple processes. Multiple processes is a good model anyways because it scales to clusters of machines.
It's probably not as expensive as having a Global Interpreter Lock (GIL) that prevents multiple threads from running Python code at the same time, diluting any benefits you would see from concurrent reactors.
No it can not use two reactors. Even if it could, you wouldn't get much better performance due to the GIL. -bob

Bob Ippolito schrieb:
Multiple processors, multiple processes. Multiple processes is a good model anyways because it scales to clusters of machines.
True. That's actually a current side effect of my program.
Sure, the GIL. I read about it when I started using Python, but I must have forgotten it. I guess you're right, multiple processes is simple to do and it does even have some advantages here. Thanks, Stefan
participants (2)
-
Bob Ippolito
-
Stefan Behnel