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,
Livelock
Livelock occurs when two or more processes continually repeat the same interaction in response to changes in the other processes without doing any useful work
Race condition
A race condition or race hazard is the condition of an electronics, software, or other system where the system’s substantive behavior is dependent on the sequence or timing of other uncontrollable events. It becomes a bug when one or more of the possible behaviors is undesirable
Atomicity
Computing. Atomicity (database systems), a property of database transactions which are guaranteed to either completely occur, or have no effects. Atomicity (programming), an operation appears to occur at a single instant between its invocation and its response.
Critical Section
In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behavior, so parts of the program where the shared resource is accessed need to be protected in ways that avoid the concurrent access. This protected section is the critical section or critical region.
Lock methodology
For this purpose, in the locking method, a lock is associated with every data item. It is assumed that each transaction before performing a read or write operation on a data item must lock it, and that each transaction will release all locks it holds before its completion.
Thrashing
In computer science, thrashing occurs when a computer’s virtual memory resources are overused, leading to a constant state of paging and page faults, inhibiting most application-level processing. This causes the performance of the computer to degrade or collapse
page swaps,
The process of writing pages out to disk to free memory is called swapping-out. If later a page fault is raised because the page is on disk, in the swap area rather than in memory, then the kernel will read back in the page from the disk and satisfy the page fault. This is swapping-in
Page faults
Page faults are generated when an application tries to use memory that is part of its working set, but can’t find it. Page faults can be either hard or soft: Hard page faults occur when the page is found in the page file on the hard disk. Soft page faults happen when the page is found somewhere else in memory.
Virtual memory management
Virtual memory is a memory management technique where secondary memory can be used as if it were a part of the main memory. Virtual memory is a common technique used in a computer’s operating system (OS). … Mapping chunks of memory to disk files enables a computer to treat secondary memory as though it were main memory