Title: InterProcess Communication Models
1Inter-Process Communication Models
- September 23, 2004
- Myeong-Wuk Jang
- Open Systems Laboratory
2Outline
- Introduction
- Linda
- JavaSpace
- ActorSpace
- Directory Facilitator
- ATSpace in the extended AA
- Conclusion
3Motivation
- Parallel and Distributed Computation
- Process Communication
- Reference-based Communication
- Channel (or Link)
- Binding of Time
message
sender
receiver
4Motivation
- Problems
- Open Systems
- Processes (Actors or Agents) can enter and leave
at any time - Agent Mobility
- The location of an agent cannot be predefined
- Indirect Inter-Process Communication
- Data-oriented Communication
- Attribute-based Communication
5The Linda Model
- David Gelernter
- Yale University
- Data-oriented communication model
- Concurrent process interaction model
- Virtual shared memory model
- A model of process creation and coordination
- Tuple Space (TS)
- Tuples
6Tuple Space Tuples
- Tuple Space (TS)
- Virtual shared memory
- Abstract communication environment
- Pattern matching on the tuples
- Tuples
- A typed sequence of data
- Tuple Template tuple
- that has formal parameters
(a string, 15.01, 17, another string)
(a string, ? f, ? i, another string)
7Linda Basic Primitives
- out (write)
- generate a tuple and add it to Tuple Space
- out(a string, 15.01, 17, another string)
- out(0, 1)
- in (take)
- cause a search in Tuple Space, remove a matching
tuple from the space, and return the tuple - in(a string, ? f, ? i, another string)
- rd (read)
- like in, but do not remove the tuple.
- rd(a string, ? f, ? i, another string)
8Example - I
- out(a string, 15.01, 17, another string)
- rd(a string, ? f, ? i, another string)
- in(a string, ? f, ? i, another string)
TS
out(a string, 15.01, 17, another string)
(a string, 15.01, 17, another string)
9Example - I
- out(a string, 15.01, 17, another string)
- rd(a string, ? f, ? i, another string)
- in(a string, ? f, ? i, another string)
TS
rd(a string, ? f, ? i, another string)
(a string, 15.01, 17, another string)
f 15.01 i 17
10Example - I
- out(a string, 15.01, 17, another string)
- rd(a string, ? f, ? i, another string)
- in(a string, ? f, ? i, another string)
TS
in(a string, ? f, ? i, another string)
(a string, 15.01, 17, another string)
f 15.01 i 17
11Linda Additional Primitives
- Extended Primitives (non-blocking operators)
- inp
- rdp
- eval
- generate active tuple process
- eval(M, i, j, compute(i, j))
12Example - II
- eval(fac, 7, fac(7))
- rd(fac, 7, ? value)
TS
eval(fac, 7, fac(7))
(fac, 7, 4020)
(fac, 7, fac(7))
13Example - II
- eval(fac, 7, fac(7))
- rd(fac, 7, ? value)
TS
rd(fac, 7, ? value)
(fac, 7, 4020)
value 4020
14Example - III
- matrix_multiply(X,Y,Z)
- double Xnn, Ynn, Znn
-
- matrix_transpose(Y, Y)
- for (i0 i lt n i)
- for (j0 j lt n j)
-
- ID in j
- eval("dot", ID, dot_product(Xi, Yj))
-
- for (i0 i lt n i)
- for (j0 j lt n j)
-
- ID in j
- in("dot", ID, Zij)
-
-
15Characteristics
- A few operators
- Easy to use
- eval operator for parallel operations
- A data-oriented communication model
- Pattern matching on tuples (tuple signature)
- A sender does not know anything about receivers
- A receiver does not know anything about the
sender of a tuple
16JavaSpace
- Sun Microsystems
- A reliable distributed storage system for objects
- A distributed persistence and object exchange
mechanism - JINI and RMI (Remote Message Invocation)
17Entry and Template
- Entry
- A typed group of objects
- Template
- An object that has some or all of its fields set
to specified values
18Operators
- write
- write an entry
- read
- read an entry
- take
- read an entry, and remove it from the space
- notify
- notify a specified object when an entry is written
19Characteristics
- Rich typing
- No eval operator
- A data-oriented communication model
- pattern matching of entries
- A reliable distributed storage system
- Distributed object persistence
20ActorSpace
- Christian J. Callsen
- Aalborg University, Denmark
- Invocation and broadcasting
- Abstract specification of a group of recipients
21Key Terminology
- actorSpace
- A computationally passive container of actors
- A context for matching patterns
- Attribute
- An abstract external description or view of an
actor or an actor group - Capability
- Key for secure access control
22Operations
- new-capability()
- create-actorSpace(capability)
- send(dest, parameter)
- broadcast(dest, parameter)
- make-visible(?, attributes_at_space, capability)
- make-invisible(?, space, capability)
- change-attribute(?, attributes_at_space, capability)
23Example
- behavior counter
- int count
- method _at_countit()
- count
-
- method _at_reprotcount()
- send(system_at_print, count)
- send(system_at_print, \n)
-
-
- method _at_main()
- capability c new-capability()
- name a1 new actor(c)
- name a2 new actor(c)
name a3 new actor(c) name s new
create_actorSpace(c) init_behavior(a1,
counter, 0) init_behavior(a2, counter,
0) init_behavior(a3, counter,
0) make_visible(s, foos_at_/,
c) make_visible(a1, foo1_at_s,
c) make_visible(a2, foo2_at_s,
c) make_visible(a3, foo3_at_s,
c) send(/foos/_at_countit) broadcast(/foos/
foo12_at_reportcount)
24Example
Actor Platform
make-visible
actor1
foo1
make-visible
send
broadcast
make-visible
actor2
actor4
foo2
foo3
make-visible
actor3
25Characteristics
- Secure communication
- Regular expression in template
- Nested actorSpaces
- Cycle problem
- A attributed-oriented communication model
- pattern nickname of an actor
- A brokering service model
26Attribute-oriented Communication Model
- A sender may not know anything about receivers
- The actual number of receivers and their
locations are hidden - A receiver may not know anything about the sender
of a message - Multicast (or broadcast) mechanisms are easily
implemented
27Directory Facilitator
- FIPA Foundation for Intelligent Physical Agents
- A yellow page directory service for agents
28Operators
- register
- enter data about an agent and its method(s)
- deregister
- remove data
- modify
- change the contents of registered data
- search
- cause pattern matching to find service agents
29Example
Agent Platform
DF
a1, fun
a2, sfun
register
a3, fun
register
agent1
register
agent2
agent4
agent3
30Characteristics
- A matchmaking service model
- A sender uses information on a virtual shared
space to find receiver agents. - A sender knows names of receivers
- A attributed-based agent name resolution
- pattern methods (services) of agents
31Middle Agent Services
- Enable discovery or access to previously unknown
agents - Examples
- Matchmaking Service (Yellow Page Service)
- cf. Directory Facilitator in FIPA
- Brokering Service
- ActorSpace
32Problems
- Expressiveness limitation
- Search algorithm is fixed
- Parameters of a template are predefined
- Incomplete Information
- Tuples in the middle agent may not have
sufficient information for query matching - ATSpace Active Tuple Space
- Open Systems Laboratory
33Brokering Service
Tuple Space
Get models of offered computers?
UAN2, Champaign, computer, 950
UAN3, Urbana, computer, 650
UAN2, Urbana, printer, 120
UAN4, Austin, computer, 1290
UAN1buyer
UAN3seller
UAN4seller
UAN2seller
34Matchmaking Service
Tuple Space
Get models of offered computers?
UAN2, Champaign, computer, 950
UAN3, Urbana, computer, 650
UAN2, Urbana, printer, 120
UAN4, Austin, computer, 1290
UAN1buyer
UAN3seller
UAN4seller
UAN2seller
35A Challenging Query
Tuple Space
Get models offered by best two sellers within 20
miles from my city?
UAN2, Champaign, computer, 950
UAN3, Urbana, computer, 650
UAN2, Urbana, printer, 120
UAN4, Austin, computer, 1290
UAN1buyer
UAN3seller
UAN4seller
UAN2seller
36A Challenging Query
Tuple Space
Get models offered by best two sellers within 20
miles from my city?
UAN2, Champaign, computer, 950
UAN3, Urbana, computer, 650
Translate into an easy query
UAN2, Urbana, printer, 120
Filter the result
Continue as before
UAN4, Austin, computer, 1290
- Inefficient ad-hoc solution
- The translated query results in a large amount
of tuples sent back - Can we do better?
UAN1buyer
UAN3seller
UAN4seller
UAN2seller
37The ATSpace Approach
ATSpace
Get models offered by best two sellers within 20
miles from my city?
UAN2, Champaign, computer, 950
UAN3, Urbana, computer, 650
UAN2, Urbana, printer, 120
UAN4, Austin, computer, 1290
UAN1buyer
UAN3seller
UAN4seller
UAN2seller
38Architecture of ATSpace
ATSpace
Tuple Space
message queue
tuple
msg
msg
msg
tuple
return names (matchmaking)
tuple
Tuple Space Manager
tuple
ask service agents (brokering)
39ATSpace
- Common Shared Space
- write, read, take
- writeAll, readAll, takeAll
- Middle Agent Services
- matchmaking services search, searchAll
- brokering services deliver, deliverAll
- Active services mobile objects transmitted for
remote search - Service Call Message Generation Services
- Service call messages may be different for
matched agents and generated by the supplied
object
40Security Issues
- Data Integrity
- Prevent modification of the original data
- Deep copy of data
- Denial of Service
- Consumption of all processor cycles
- User-level thread scheduling
- Illegal Access
- Unauthorized access
- Access keys
41Extended Architecture of ATSpace
42Characteristics
- Common Shared Space
- Middle Agent
- Brokering Matchmaking Services
- Active Brokering Matchmaking Services
- Execution Environment for Mobile Objects
43Summary
- Process / Actor / Agent Communication
- Reference-based Communication
- Attributed-based Communication
- Attribute-oriented Communication Model
- Linda
- JavaSpace
- ActorSpace
- Directory Facilitator
- ATSpace
- Middle Agent / Actor Services
- Matchmaking Service
- Brokering Service
44The End
- Thanks for your attention.
45References
- D. Gelernter, Generative Communication in Linda,
ACM Transactions on Programming Language and
Systems, 7(1) 80-112, 1985. - N. Carreiro, and D. Gelernter, Linda in
context, Communications of the ACM, Vol. 32, No.
4, pp. 444-458, 1989. - Sun Microsystems, JavaSpacesTM Service
Specification, version 2.0, June 2003.
http//java.sun.com/products/jini/specs - C. Callsen and G. Agha, Open Heterogeneous
Computing in ActorSpace, Journal of Parallel and
Distributed Computing, Vol. 21, No. 3, pp.
289-300, 1994. - Foundation for Intelligent Physical Agents,
SC00023J FIPA Agent Management Specification,
December 2002. http//www.fipa.org/specs/fipa00023
/ - M. Jang, A. Abdel Momen, and G. Agha, "ATSpace A
Middle Agent to Support Application-Oriented
Matchmaking and Brokering Services," IEEE/WIC/ACM
IAT(Intelligent Agent Technology)-2004, September
20-24, Beijing, China, 2004.