Marcel Keller <mkel...@cs.au.dk> writes:

>>>> Indeed we did not know (well I didn't) back then that the data was
>>>> not sent immediately by Twisted, and I was starting to think
>>>> yesterday whether the hack would make a difference. Lucky for us, it
>>>> apparently does :)
>>> That is not the only problem. To free the memory of the shares and to
>>> send out further shares, also the incoming shares must be processed as
>>> soon as possible. This is even trickier because incoming shares might
>>> trigger code that calls functions sending out data, which activates
>>> the Twisted reactor again and therefore leads to a possibly too deep
>>> recursion. I think I have a solution for that, it just wasn't
>>> necessary to implement it for now because the hack worked anyway.
>>
>> I guess we could simply not recurse if the recursion depth is too big?
>>
>> At some point we have to let the recursive calls finish in order to let
>> the local variables and stack frames be garbage collected.
>
> Yes, but If we just stop recursing at a certain level, we might just
> stay at that level for a longer time. That is also not optimal. In my
> opinion, another point for the two-threaded solution.

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

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.

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.

Please see these links for some discussion on this so-called Global
Interpreter Lock (GIL):

  http://www.artima.com/weblogs/viewpost.jsp?thread=214235
  
http://www.python.org/doc/faq/library/#can-t-we-get-rid-of-the-global-interpreter-lock

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.

Attachment: pgpsk7RDTH9ae.pgp
Description: PGP signature

_______________________________________________
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk

Reply via email to