[e-lang] Re: Observation with timeout

Michael Sperber sperber at informatik.uni-tuebingen.de
Mon Dec 27 04:43:50 EST 2004


>>>>> "Kevin" == Kevin Reid <kpreid at attglobal.net> writes:

Kevin> On Dec 16, 2004, at 13:40, Michael Sperber wrote:

>> Let's say, the client is a web server that's talking to some database
>> that gives out locks to some data.  The client tries to answer the
>> request and therefore tries to obtain the lock.  However, it wants to
>> send back a meaningful message in case it can't obtain the lock within
>> a timeout period.


Kevin> def makeRevoker := <import:org.erights.e.facet.makeRevoker>
Kevin> def dbLock := makeLock()

Kevin> [...]

Many thanks!

Could you provide a usage example for this?  I'm still having some
trouble getting my fingernails on E code samples as large as this
one.  Specifically, what's the role of the "handler"?

>> Sure---but for all practical purposes, E seems to provide the same
>> thing among the promises run by the event loop: they communicate
>> amongst each other by state.  The promises, as computational agents,
>> correspond to CML threads.

Kevin> This statement seems strange to me, made about promises. If you mean
Kevin> objects, then yes, they have state, and the aggregation of all objects
Kevin> in a Vat corresponds to a thread.

Yes, that's exactly it.

Kevin> My actual programming experience has been almost entirely in
Kevin> single-threaded environments, with event loops and/or
Kevin> synchronous-remote-call, so E is very familiar to me. I've been trying
Kevin> to provide examples, and I do *believe* that E's concurrency model is
Kevin> good, but I don't have any concrete evidence or arguments.

Your examples have been excellent, and it seems to me that E is a
clear improvement on vanilla event-loop programming and concurrent
programming with shared state and mutual exclusion.  It's currently
less clear to me that it's an improvement on CML-style concurrent
programming---I need to understand E better.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla


More information about the e-lang mailing list