Its literal meaning
is “happening at same time”. Whereas in context of object it’s the property
that distinguishes an active object from the one that is not active. The object
oriented programming focuses upon data abstraction, encapsulation and
inheritance, concurrency focuses upon process abstraction ad synchronization.
The object is a concept that unifies these two different viewpoints : each
object (drawn from an abstraction of the real world) may represent a separate
thread of control (a process abstraction). Such objects are called active . In
a system based on an object-oriented design. We can conceptualize the world as
consisting of a set of cooperative objects.some of which are active and thus
serve as centers of independent activity. There are three approaches to
concurrency in OOD:
- Concurrency as an intrinsic feature of certain programming languages.
- A language may use a class library that implements concurrency
- Interrupts can be used to give illusion of concurrency, but it requires knowledge of certain low level hardware details
No
matter which approach to concurrency we take one of the realities about
concurrency is that once you introduce it into a systems. We must consider how
active objects synchronize their activities with one another as well as with
objects that are purely sequential. For example, if two active objects try to
send messages to a third object, we must be certain to use some means of mutual
exclusion, so that state of object being acted upon is not corrupted when both
active objects try to update its state simultaneously. This is the point where
the ideas of abstraction,encapsulation & concurrency interact.
No comments:
Write comments