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
  • Semaphores
  • POSIX semaphores
  • Shared memory
  1. Semaphores and Shared memory

Unix IPC primitives

Semaphores

System V semaphores

creation: semget

down and up: semop

other operations: semctl

execute man semget, man semop or man semctl for a description

POSIX semaphores

Two types: named and unnamed semaphores.

Named semaphores.

  • sem_open, sem_close, sem_unlink

  • created in a virtual filesystem (e.g., /dev/sem).

unnamed semaphores – memory based

  • sem_init, sem_destroy

down and up.

  • sem_wait, sem_trywait, sem_timedwait, sem_post

execute man sem_overview for an overview.

Shared memory

Address spaces of processes are independent.

But address spaces are virtual.

The same physical region can be mapped into two or more virtual regions.

This is managed as a resource by the operating system.

System V shared memory

  • creation – shmget

  • mapping and unmapping – shmat, shmdt

  • other operations – shmctl

  • execute man shmget, man shmat man shmdt or man shmctl for a description.

POSIX shared memory

  • creation - shm open, ftruncate

  • mapping and unmapping - mmap, munmap

  • other operations - close, shm unlink, fchmod,...

  • execute man shm_overview for an overview

PreviousShared memoryNextThreads

Last updated 2 years ago