Marcel Keller <mkel...@cs.au.dk> writes: >> 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.
Yeah, I think it would help too. >> 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. It's funny -- then we'll have sort of two event loops. > 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. So you'll have something when I get back from PKC? :) Seriously, I think you're right, the code is fairly well partitioned already, so we should be able to make this change without too much trouble. >> 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 threads. > > 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. Right, that should help us! Janus has been looking more into Python threads, so be sure to discuss it with him too. -- Martin Geisler VIFF (Virtual Ideal Functionality Framework) brings easy and efficient SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
Description: PGP signature
_______________________________________________ viff-devel mailing list (http://viff.dk/) firstname.lastname@example.org http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk