2 Aug 2005 17:27
Re: newbie question: multiple vats?
On Aug 2, 2005, at 0:54, acd dfg wrote:
> I've just started learning about E (I'm reading "E in a Walnut" now)
> and saw this question in the FAQ:
>
>> 3.2. If an E process is single-threaded, how to take advantage of
>> parallelism (e.g. on SMP's)?
>>
>> [To be answered: micro-parallelism and/or multiple vats]
>
> I didn't see an answer for this in "E in a Walnut" or via Google, so I
> was wondering:
>
> If I were doing a producer/consumer exercise in Java with n producers
> and 1 consumer, I'd create n producer threads and 1 consumer thread.
> How would this sort of thing be handled in E?
Here's a simple and silly example showing how to set up several vats to
perform parallel computations.
#!/usr/bin/env rune
pragma.enable("easy-return")
pragma.disable("explicit-result-guard")
# Necessary for general inter-vat communication.
introducer.onTheAir()
# A simple interface for creating a vat.
def seedVat := <import:org.erights.e.elang.interp.seedVatAuthor> \
(Continue reading)
RSS Feed