Notes - MIECT
Sistemas De Operação
Notes - MIECT
Sistemas De Operação
  • Sistemas de Operação
  • Processes in Unix/Linux
    • Process
    • Multiprocessing vs. Multiprogramming
    • Processes in Unix
    • Execution of a C/C++ program
  • Introduction to operating systems
    • Global view
    • Evolution of computational systems
    • Key topics
  • Semaphores and Shared memory
    • Concepts
    • Semaphores
    • Shared memory
    • Unix IPC primitives
  • Threads, mutexes and condition variables in Unix/Linux
    • Threads
      • In linux
    • Monitors
    • Unix IPC primitives
  • Processes
    • Process
      • Diagrams
    • Process control table
    • Context switching
    • Threads
  • Processor Scheduling
    • Processor Scheduler
    • Short-term processor scheduler
    • Scheduling algorithms
    • Scheduling criteria
    • Priorities
    • Scheduling policies
      • In Linux
  • Interprocess communication
    • Concepts
    • Philosopher dinner
    • Access primitives
      • Software solutions
      • Hardware solutions
    • Semaphores
    • Monitors
    • Message-passing
    • Unix IPC primitives
  • Deadlock
    • Introduction
    • Philosopher dinner - Solution 1
      • Deadlock prevention
    • Philosopher dinner - Solution 2
      • Deadlock prevention
    • Philosopher dinner - Solution 3
      • Deadlock prevention
    • Philosopher dinner - Solution 4
    • Deadlock avoidance
    • Deadlock detection
  • Memory management
    • Introduction
    • Address space
    • Contiguous memory allocation
    • Memory partitioning
    • Virtual memory system
    • Paging
    • Segmentation
    • Combining segmentation and paging
    • Page replacement
      • Policies
    • Working set
    • Thrashing
    • Demand paging vs. preparing
Powered by GitBook
On this page
  • Independent and collaborative processes
  • Independent processes competing for a resource.
  • Cooperative processes sharing information or communicating.
  • Critical section
  • Deadlock and starvation
  1. Semaphores and Shared memory

Concepts

PreviousKey topicsNextSemaphores

Last updated 2 years ago

Independent and collaborative processes

In a multiprogramming 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 loss occurs.

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

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

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 loss 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, called critical section, if not properly protected, can result in race conditions.

A race condition is a condition where the behavior (output, result) depends on the sequence or timing of other (uncontrollable) events.

  • Can result in undesirable behavior.

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.