CS 3100 Flashcards
text section
A text segment, also known as a code segment or simply as text, is one of the sections of a program in an object file or in memory, which contains executable instructions.
As a memory region, a text segment may be placed below the heap or stack in order to prevent heaps and stack overflows from overwriting it.
Stack
The stack area traditionally adjoined the heap area and grew in the opposite direction; when the stack pointer met the heap pointer, free memory was exhausted. (With modern large address spaces and virtual memory techniques they may be placed almost anywhere, but they still typically grow in opposite directions.)
Data Segment
Initialized data segment, usually called simply the Data Segment. A data segment is a portion of the virtual address space of a program, which contains the global variables and static variables that are initialized by the programmer.
Segmentation
Segmentation speeds up a computer’s information retrieval by assigning related data into a “segment table” between the CPU and the physical memory
Paging
Paging is a basic function in memory management for a computer’s operating system (OS) as well – this includes Windows, Unix, Linux and macOSs. In a memory management system that takes advantage of paging, the OS reads data from secondary storage in blocks called pages, all of which have identical size.
Process states
NEW- The process is being created.
READY- The process is waiting to be assigned to a processor.
RUNNING- Instructions are being executed.
WAITING- The process is waiting for some event to occur(such as an I/O completion or reception of a signal).
TERMINATED- The process has finished execution.
Scheduling algorithms
First-Come, First-Served (FCFS) Scheduling. Shortest-Job-Next (SJN) Scheduling. Priority Scheduling. Shortest Remaining Time. Round Robin(RR) Scheduling. Multiple-Level Queues Scheduling.
Multi threading
Multithreading is a model of program execution that allows for multiple threads to be created within a process, executing independently but concurrently sharing process resources. Depending on the hardware, threads can run fully parallel if they are distributed to their own CPU core
Shared thread resources
Resource sharing: Resources like code, data, and files can be shared among all threads within a process. Note: stack and registers can’t be shared among the threads. Each thread has its own stack and registers
fork() system call
Fork system call is used for creating a new process, which is called child process, which runs concurrently with the process that makes the fork() call (parent process). After a new child process is created, both processes will execute the next instruction following the fork() system call. A child process uses the same pc(program counter), same CPU registers, same open files which use in the parent process
Interprocess Communication
In computer science, inter-process communication or interprocess communication refers specifically to the mechanisms an operating system provides to allow the processes to manage shared data
Interprocess Communication (IPC) Shared Memory
Inter Process Communication through shared memory is a concept where two or more process can access the common memory. And communication is done via this shared memory where changes made by one process can be viewed by another process
Message passing
Message passing model allows multiple processes to read and write data to the message queue without being connected to each other. Messages are stored on the queue until their recipient retrieves them. Message queues are quite useful for interprocess communication and are used by most operating systems.
Message passing systems
A message-passing system has at least two primitive operations:
send(message)
receive(message)
The messages could be of a fixed size or a variable size
Deadlock
A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource,