User loginNavigation |
Distributed Functional ProgrammingFirst – a few words to describe the problem context. Looking at Croquet architecture that proclaims as its ultimate goal to provide “truly large scale distributed computing platform, consisting of heterogeneous computing devices distributed throughout a planet-scale communications network†brought to my mind an old idea of Virtual Worlds on Internet. [see also my abstract of distributed objects in Croquet here] It happened so that back then (about 10 years ago) I was taking part in creating such VRML (Virtual Reality Modeling Language) worlds at Paragraph when the idea of collaborative 3D Internet was very hot and seemed to be a real next “big thingâ€. Being all my programming life an “object-oriented†kind, I spent a lot of time on solving the problem of object state synchronization across REAL internet. By real network I mean network with unpredictable failures, delivery times and congestions conditions. Those days this and other problems / advantages of distributed objects were actively discusses at Distributed Coalition at Caltech, that I was a member of then and that today doesn’t exist any more, which is really sad. Anyway, back to the old problem and its possible solution in realm of functional programming that I am looking for. In distributed object systems similar to Croquet (virtual worlds on the net), one and the same real world object must be represented on several networked machines. This representation should contain both consistent object state and object visual image correctly reflecting this state. A simple example is an avatar – a “shadow†of the real world user. Avatars can form a work group that stands for real humans physically “distributed†on the net. When object state changes (a user start pacing the room) its visual image must reflect these changes consistently and “simultaneously†at ALL network nodes “AWARE†about this object.To create network-wide “awareness†some systems, including Croquet, create object “replicas†that exist on all nodes in one ore more groups. “Original†object controls all its replicas sending them messages. These messages may contain state notification events, state-change commands or “active objects†implementing some behavior. To ensure consistent object state across all replicas Croquet uses two-phase commit protocol. In short object updates its state through the following steps: 1) object state is going to change There are several problems with this protocol on real internet: 1) Scalability – system doesn’t scale well when number of replicas grows over hundred. As 2) Reliability – some replicas may not receive final decision from muster object at all (see step 6 above). In this case on the node where replica failed to receive final instruction this object state becomes inconsistent with the rest of the world. Also local world on this node as a whole becomes inconsistent as well. To repair such node a sophisticated re-synchronization with the rest of the world is required. Croquet architecture document does not say anything about re-synchronization mechanisms. To conclude: two-phase commit protocol is good enough for banking transactions on highly reliable networks but does not work for real internet ! Now back to my quest. I am new to functional programming with just some knowledge of (define (mk-replica master-env) (lambda (remote-env) (display master-env) (newline) (display remote-env))) (define replica (mk-replica "master-object-env")) (define (remote-test) (replica "local-replica-env")) Such “functional object replicas†can be sent as messages to remote nodes. Master object can then in turn send messages or other function-objects to these replicas to realize, for example, two-phase commit protocol. Still the problem of state synchronization remains unsolved. It looks like Glassgow Distributed Haskell As long as functional programming allows immutable, persistent, “pure functional†data structures it would be interesting to extend these for distributed systems similar to Croquet and other virtual worlds on the Internet (like described here). Any ideas how to do Distributed Functional Programming with “pure functional†data By Dmitri Kondratiev at 2004-10-15 16:22 | LtU Forum | previous forum topic | next forum topic | other blogs | 13614 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago