You're talking about this two-threaded solution as if it is something
that exists and will solve all our problems...

No, for now, it's just an imagination in my mind, a proposal for the next meeting, and a strong feeling that it's the right way to do it.

But I still haven't seen it, and I would like to see how you can cleanly
seperate the work of the two threads. I'm afraid that the threads will
be alternating between working and waiting on the other thread in such a
way that we could just as well use one thread.

My idea is that the Twisted main loop runs in one thread and most of the VIFF code in the other. The Twisted thread only waits for I/O and the VIFF thread only waits if there is no work to be done.

If the group decides to give this idea a try, I would be happy to implement it. I would claim that it can be done in one or two weeks.

Also, threading in Python is unfortunately not optimal :-( The Python VM
will use a single thread to execute the bytecode, even when using
multiple thread in Python. It is only if the threads do things blocking
for I/O that you will see a performance increase by using multiple

I'm aware that Python only runs on one CPU, a friend pointed that out to me today. However, the Twisted thread mentioned above would block on I/O.

viff-devel mailing list (

Reply via email to