Preview

Cis Memory Management

Powerful Essays
Open Document
Open Document
1581 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Cis Memory Management
CIS:328

Abstract
The purpose of this paper is to show how memory is used in executing programs and its critical support for applications. C++ is a general purpose programming language that runs programs using memory management. Two operating system environments are commonly used in compiling, building and executing C++ applications. These are the windows and UNIX / Linux (or some UNIX / Linux derivative) operating system. In this paper we will explore the implementation of memory management, processes and threads.
Memory Management

What is a Memory Model?
A memory model allows a compiler to perform many important optimizations. Even simple compiler optimizations like loop fusion move statements in the program can influence the order of read and write operations of potentially shared variables. Changes in the ordering of reads and writes can cause race conditions. Without a memory model, a compiler is not allowed to apply such optimizations to multi-threaded programs in general, or only in special cases.
Modern programming languages like Java therefore implement a memory model. The memory model specifies synchronization barriers that are established via special, well-defined synchronization operations such as acquiring a lock by entering a synchronized block or method. The memory model stipulates that changes to the values of shared variables only need to be made visible to other threads when such a synchronization barrier is reached. Moreover, the entire notion of a race condition is entirely defined over the order of operations with respect to these memory barriers.
These semantics then give optimizing compilers a higher degree of freedom when applying optimizations: the compiler needs to make sure only that the values of (potentially shared) variables at synchronization barriers are guaranteed to be the same in both the optimized and un-optimized code. In particular, reordering statements in a block of code that contains no synchronization barrier is

You May Also Find These Documents Helpful

  • Better Essays

    Week 5 Pos 355

    • 2010 Words
    • 9 Pages

    Memory management is an important part of an operating. The UNIX/Linux OS use numerous intricate algorithms for memory management which will permit the system to…

    • 2010 Words
    • 9 Pages
    Better Essays
  • Satisfactory Essays

    Nt1310 Unit 1 Study Guide

    • 378 Words
    • 2 Pages

    Multiple threads can interfere with each other when sharing hardware resources such as caches or translation lookaside buffers (TLBs). As a result, execution times of a single thread are not improved but can be degraded, even when only one thread is executing, due to lower frequencies or additional pipeline stages that are necessary to accommodate thread-switching hardware.…

    • 378 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt1310 Unit 3 Os

    • 1341 Words
    • 6 Pages

    +• Synchronization: With multiple active processes having potential access to shared address spaces or shared I/O resources, care must be taken to provide effective synchronization. Synchronization is a facility that enforces mutual exclusion and event…

    • 1341 Words
    • 6 Pages
    Good Essays
  • Powerful Essays

    In this lab you will be writing a dynamic storage allocator for C programs, i.e., your own version of the malloc, free and realloc routines. You are encouraged to explore the design space creatively and implement an allocator that is correct, efficient and fast.…

    • 2325 Words
    • 10 Pages
    Powerful Essays
  • Better Essays

    Andrew D. Birrell: (1995) Programming with Threads, Research Report 35, Systems Research Center, Digital Equipment Corporation.…

    • 962 Words
    • 4 Pages
    Better Essays
  • Good Essays

    1. Consider a concurrent program with two processes, p and q, defines as follows. A, B, C, D and E are arbitrary atomic ( indivisible ) statements. Assume that the main program ( not shown ) does a parbegin of the two processes.…

    • 810 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    This “Case Study” cover information on computer systems with multicore processors which can increase performance by running applications of various types (models) and methods. This paper focuses on applications using distributed architecture, cache contention, prefetching hardware and more. Current and future contentions are discussed. Managing contention for shared resources on multicore processors are discussed in this assignment. Explanations given for causes of contention. Discussion of the author’s testing of applications, building of prototypes and more. The discussion of architecture software and hardware as well as methods to avoid and other alternatives and solutions (Fedorova, Blagodurov & Zhuravlev, 2006; 2009).…

    • 1554 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Memory Management

    • 341 Words
    • 2 Pages

    Memory management is the process of managing computer memory. The memory management subsystem of the operating system carries out this task. Since the beginning of computing, there has always existed the need for more memory than the existing physical memory in the system. Both Windows and Linux are operating systems. These operating systems perform basic tasks, such as tracking of directories and files on the disk, sending output to the screen for display, recognizing input from the keyboard and controlling peripheral devices such as drives and printers. The following are the differences in memory management between Linux and Windows (Godbole & Kahate, 2011).…

    • 341 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Memory Management Paper

    • 434 Words
    • 2 Pages

    In Windows OS the memory manager implements virtual memory provides a core set of services such as memory mapped files, copy-on-write memory, large memory support, and underlying support for the cache manager. According to Microsoft each process on 32-bit Microsoft Windows has its own virtual address space that enables addressing up to 4 gigabytes of memory. Each process on 64-bit Windows has a virtual address space of 8 terabytes. All threads of a process can access its virtual address space. However, threads cannot access memory that belongs to another process, which protects a process from being corrupted by another process.…

    • 434 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    The C++ programming language was introduced by Bjarne Stroustrup of the AT&T laboratories in 1985 as an extension of C, with additional features borrowed from the esoteric language Simula. Since then, C++ has grown rapidly in response to the practical need for a programming language that is able to efficiently handle composite and diverse data types. The language implementation is pivoted on the ingenious concept of object oriented programming (OOP). Today, C++ dominates the commercial market and is favored among system programmers and…

    • 4389 Words
    • 18 Pages
    Powerful Essays
  • Good Essays

    Side effects are the most common way that a program interacts with the outside world (people, filesystems, other computers on networks). But the degree to which side effects are used depends on the programming paradigm. Imperative programming isknown for its frequent utilization of side effects. In functional programming , side effects are rarely used. Functional languages such as Standard ML , Scheme and Scala do not restrict side effects, but it is customary for programmers to avoid them. [3] The functional language Haskell restricts side effects with a static type system ; it uses the concept of monads to do stateful and IO computations. [4] [5]…

    • 351 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Malloc

    • 3330 Words
    • 14 Pages

    In this assignment you will write a dynamic storage allocator for C programs, that is, your own…

    • 3330 Words
    • 14 Pages
    Powerful Essays
  • Better Essays

    Lock Free Data Structures

    • 3562 Words
    • 16 Pages

    In short, with lock-based multithreaded programming, you need to make sure that any operation on…

    • 3562 Words
    • 16 Pages
    Better Essays
  • Powerful Essays

    Osnotes

    • 18736 Words
    • 75 Pages

    SYLLABUS CS1253 – OPERATING SYSTEMS UNIT I PROCESSES AND THREADS Introduction to operating systems – Review of computer organization – Operating system structures – System calls – System programs – System structure – Virtual machines – Processes – Process concept – Process scheduling – Operations on processes – Cooperating processes – Inter process communication – Communication in client – Server systems – Case study – IPC in linux – Threads – Multi-threading models – Threading issues – Case study – Pthreads library. UNIT II PROCESS SCHEDULING AND SYNCHRONIZATION CPU scheduling – Scheduling criteria – Scheduling algorithms – Multiple – Processor scheduling – Real time scheduling – Algorithm evaluation – Case study – Process scheduling in Linux – Process synchronization – The criticalsection problem – Synchronization hardware – Semaphores – Classic problems of synchronization – Critical regions – Monitors – Deadlock – System model – Deadlock characterization – Methods for handling deadlocks – Deadlock prevention – Deadlock avoidance – Deadlock detection – Recovery from deadlock. UNIT III STORAGE MANAGEMENT Memory management – Background – Swapping – Contiguous memory allocation – Paging – Segmentation – Segmentation with paging – Virtual memory – Background – Demand paging – Process creation – Page replacement – Allocation of frames – Thrashing – Case study – Memory management in linux . UNIT IV FILE SYSTEMS File system interface – File concept – Access methods – Directory structure – Filesystem mounting – Protection – File system implementation – Directory implementation – Allocation methods – Free space management – Efficiency and performance – Recovery – Log-structured file systems – Case studies – File system in linux – File system in Windows XP. UNIT V I/O SYSTEMS I/O systems – I/O hardware – Application I/O…

    • 18736 Words
    • 75 Pages
    Powerful Essays
  • Good Essays

    Mcse 011(Mca 5)Ignou

    • 1946 Words
    • 8 Pages

    A.J.Bernstein has elaborated the work of data dependency and derived some conditions based on which we can decide the parallelism of instructions or processes. Bernstein conditions are based on the following two sets of variables: i) The Read set or input set RI that consists of memory locations read by the statement of instruction I1. ii) The Write set or output set WI that consists of memory locations written into by instruction I1. The sets RI and WI are not disjoint as the same locations are used for reading and writing by SI. The following are Bernstein Parallelism conditions which are used to determine whether statements are parallel or not: 1) Locations in R1 from which S1 reads and the locations W2 onto which S2 writes must be mutually exclusive. That means S1 does not read from any memory location onto which S2 writes. It can be denoted as: R1∩W2= 2) Similarly, locations in R2 from which S2 reads and the locations W1 onto which S1 writes must be mutually exclusive. That means S2 does not read from any memory location onto which S1 writes. It can be denoted as: R2∩W1= 3) The memory locations W1 and W2 onto which S1 and S2 write, should not be read by S1 and S2. That means R1 and R2 should be independent of W1 and W2. It can be denoted as : W1∩W2= To show the operation of Bernstein’s conditions, consider the following instructions of sequential program:…

    • 1946 Words
    • 8 Pages
    Good Essays