Thursday, July 16, 2009

COOPERATING PROCESSES

Advantages of process cooperation

  • Information sharing
  • Computation speed-up
  • Modularity
  • Convenience

Independent process cannot affect/be affected by the execution of another process, cooperating ones can

Issues

  • Communication
  • Avoid processes getting into each other’s way
  • Ensure proper sequencing when there are dependencies

Common paradigm: producer-consumer

  • unbounded-buffer - no practical limit on the size of the buffer
  • bounded-buffer - assumes fixed buffer size

INTERPROCESSES COMMUNICATION

For communication and synchronization

  • Shared memory
  • OS provided IPC

Message system

  • no need for shared variable
  • two operations
  • send(message) – message size fixed or variable
  • receive(message)

If P and Q wish to communicate, they need to

  • establish a communication link between them
  • exchange messages via send/receive

Implementation of communication link

  • physical (e.g., shared memory, hardware bus)
  • logical (e.g., logical properties)
    4

No comments: