Erlang (was: Re: Generics)
Ned Konz
ned at bike-nomad.com
Mon Nov 10 19:18:16 UTC 2003
On Sunday 09 November 2003 11:17 am, Hans Nikolaus Beck wrote:
> Whow could objects be processes ?For me objects represent a certain
> state. Their methods are rules how to make a transition to another
> state. But processes have no state in that sence that they are a chain
> of infinitesimal transitions. From this theoretical point of view, a
> "process" in a system of objects (i.e. a loop) is not a process, only a
> quick sequence of transitions......
>
> Where is my error in logic ?
Objects provide behavior and collaborate with other objects. There's nothing
that says they can't also correspond to/be/use processes.
UML, for instance, talks about "active objects" which have their own thread(s)
of control.
The "actor" languages (not to be confused with Whitewater's Actor language)
had/have this same model, as do many distributed object languages.
A very simple model of such "active objects" in Squeak could have a Process,
and a SharedQueue for incoming messages. The action of the objects would be
to take messages off their queue and process them.
I have made systems like this in which sending a message to such an object
returns a Promise. When the requester eventually evaluates the Promise, it
will either return the result of the message (if it's already been run) or
block the requester until the message has been run.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|