[viff-devel] VIFF and large scale programs -- is VIFF really asynchronous?
Martin Geisler
mg at daimi.au.dk
Mon Jan 26 10:10:49 PST 2009
T.Toft at cwi.nl writes:
> Hi all,
>
>
> A really unpleasant thought has occurred to me: Is VIFF really properly
> asynchronous? (Yes, this question is intended to provoke you into thinking
> about the issue below. Of course VIFF is asynchronous in the sense that
> there are no rounds.)
>
>
>
> If I understand/remember correctly, VIFF is 100% single threaded.
Yes! Unless you offload some heavy computation with deferToThread, then
everything is run in one thread.
> This means that if we have a small program:
>
> x, y = runtime.shamir_share([1, 2], Zp, input)
> z = x*y
> for i in xrange(100):
> z=z*z
>
> 1) We first share two values (returning immediately).
>
> 2) We start doing a lot of multiplications. However, as we don't have
> the actual shares yet, we just get deferreds.
>
> 3) Once the for-loop terminates, we return control to the
> surroundings. At this point we notice that the shares of x and y are
> there and start the actual multiplication protocols.
>
>
>
> Is my interpretation above correct? Because if it is, then this really
> explains the memory issues I've been seeing. And more importantly, it
> tells us how to actually use VIFF for large-scale computation: put in
> explicit "stops".
Yeah, that is exactly what we have to do. Twisted is built on the idea
that your code does small chunks of work, sends out some data and
arranges for a function to be called when the next piece of data is
ready. It is particularly important that the code does not hold on to
the CPU for too long -- this stops the reactor.
--
Martin Geisler
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.viff.dk/pipermail/viff-devel-viff.dk/attachments/20090126/232f04fb/attachment.pgp>
More information about the viff-devel
mailing list