Concepts

Independent and collaborative processes

In a multiprogrammed environment, two or more processes can be:

  • independent – if they, from their creation to their termination, never explicitly interact.

    • actually. there is an implicit interaction, as they compete for system resources.

    • ex: jobs in a batch system; processes from different users.

  • cooperative – if they share information or explicitly communicate.

    • the sharing requires a common address space.

    • communication can be done through a common address space or a communication channel connecting them.

Independent processes competing for a resource.

It is the responsibility of the OS to ensure the assignment of resources to processes is done in a controlled way, such that no information lost occurs.

In general, this imposes that only one process can use the resource at a time – mutual exclusive access.

Cooperative processes sharing information or communicating.

It is the responsibility of the processes to ensure that access to the shared area is done in a controlled way, such that no information lost occurs.

In general, this imposes that only one process can access the shared area at a time – mutual exclusive access.

The communication channel is typically a system resource, so processes compete for it.

Critical section

Having access to a resource or to a shared area actually means executing the code that does the access.

This section of code, if not properly protected, can result in race conditions.

  • which can result in lost of information.

  • It is called critical section.

Critical sections should execute in mutual exclusion.

Deadlock and starvation

Mutual exclusion in the access to a resource or shared area can result in:

  • deadlock – when two or more processes are waiting forever to access to their respective critical section, waiting for events that can be demonstrated will never happen.

    • operations are blocked.

  • starvation – when one or more processes compete for access to a critical section and, due to a conjunction of circumstances in which new processes that exceed them continually arise, access is successively deferred.

    • operations are continuously postponed.

Last updated