ITEC 320 Lecture 19 Higher level usage of pointers.

Slides:



Advertisements
Similar presentations
Storing Data: Disk Organization and I/O
Advertisements

Introduction to Database Systems1 Buffer Management Storage Technology: Topic 2.
ITEC 320 Lecture 12 Records. Intro to records Review Look_ahead(char,EOL); –What is this? –What does it allow us to do?
ITEC 352 Lecture 25 Memory(3). Review Questions RAM –What is the difference between register memory, cache memory, and main memory? –What connects the.
CS4432: Database Systems II Buffer Manager 1. 2 Covered in week 1.
ITEC 320 Lecture 11 Pointers(1). Pointers Review Packages –Generic –Child Homework 3 is posted.
Module R2 Overview. Process queues As processes enter the system and transition from state to state, they are stored queues. There may be many different.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Buffer management.
Buffer Cache Waits. #.2 Copyright 2006 Kyle Hailey Buffer Cache Waits Waits Disk I/O Buffer Busy Library Cache Enqueue SQL*Net Free Buffer Hot Blocks.
ITEC 352 Lecture 27 Memory(4). Review Questions? Cache control –L1/L2  Main memory example –Formulas for hits.
Graph Theory ITEC 320 Lecture 21. Graph Theory Review Higher level usage of pointers –Factories –Flyweight –Disk pool Rationale Benefits / Downsides.
ITEC 320 Lecture 12 Higher level usage of pointers.
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
Data Structures Hash Tables
1.1 Data Structure and Algorithm Lecture 9 Hashing Topics Reference: Introduction to Algorithm by Cormen Chapter 12: Hash Tables.
Dynamic memory allocation and fragmentation Seminar on Network and Operating Systems Group II.
Linked Lists Chained nodes of information create what are called linked lists, with each node providing a link to the next node. A useful feature of linked.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
03/30/2007CSCI 315 Operating Systems Design1 Virtual Memory cont’d.; File System Interface.
CS 241 Section Week #12 (04/22/10).
Layers of a DBMS Query optimization Execution engine Files and access methods Buffer management Disk space management Query Processor Query execution plan.
Hashing 1. Def. Hash Table an array in which items are inserted according to a key value (i.e. the key value is used to determine the index of the item).
File Systems (1). Readings r Silbershatz et al: 10.1,10.2,
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Games Development 2 Resource Management CO3301 Week 3.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
Buffers Let’s go for a swim. Buffers A buffer is simply a collection of bytes A buffer is simply a collection of bytes – a char[] if you will. Any information.
Data Structures Using Java1 Chapter 4 Linked Lists.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Win32 Programming Lesson 14: Introducing Windows Memory (C Rox…)
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Memory Management -Memory allocation -Garbage collection.
THE FILE SYSTEM Files long-term storage RAM short-term storage Programs, data, and text are all stored in files, which is stored on.
©Silberschatz, Korth and Sudarshan5.1Database System Concepts - 6 th Edition Procedural Constructs in SQL Chapter 5.
CS6045: Advanced Algorithms Data Structures. Hashing Tables Motivation: symbol tables –A compiler uses a symbol table to relate symbols to associated.
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
Pointers 1. Introduction Declaring pointer variables Pointer operators Pointer arithmetic 2 Topics to be Covered.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Direct memory access. IO Command includes: buffer address buffer length read or write dada position in disk When IO complete, DMA sends an interrupt request.
ITEC 352 Lecture 16 ISA(7). Review Exam / Questions? Conditional codes, how important are they? How important are comments in assembly? What are the benefits.
Data Structure and Algorithm: CIT231 Lecture 6: Linked Lists DeSiaMorewww.desiamore.com/ifm1.
Week Seven Agenda Link of the week Review week six lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines.
File-System Management
CS222: Principles of Data Management Lecture #4 Catalogs, Buffer Manager, File Organizations Instructor: Chen Li.
Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
Today topics: File System Implementation
Module 11: File Structure
CHP - 9 File Structures.
Database Applications (15-415) DBMS Internals: Part II Lecture 11, October 2, 2016 Mohammad Hammoud.
FileSystems.
CS 332: Algorithms Hash Tables David Luebke /19/2018.
CS222/CS122C: Principles of Data Management Lecture #3 Heap Files, Page Formats, Buffer Manager Instructor: Chen Li.
Database Management Systems (CS 564)
Lecture 10: Buffer Manager and File Organization
Page Replacement.
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Handles disk file 0000: array of file-offsets 0001: 0002: 0003: 0: …
Linked Lists.
Chapter 40 Remote Method Invocation
Files Management – The interfacing
Chapter 46 Remote Method Invocation
Slides developed by Dr. Hesham El-Rewini Copyright Hesham El-Rewini
Chapter 46 Remote Method Invocation
Implementation of page-replacement algorithms and Belady’s anomaly
Presentation transcript:

ITEC 320 Lecture 19 Higher level usage of pointers

Pointers Review Linked list –Pointer usage –Package design HW 1 –Write a doubly linked list that has insert before / after and delete methods –Code will be posted by tomorrow –Due next Monday at 10PM

Pointers Problems What are the major problems with pointers?

Pointers Reference counting Each object has to be uniquely tracked in a system The number of pointers to that object is also counted Whenever a pointer is disposed, the reference count is decreased What happens when it reaches 0? What problem does this resolve?

Pointers Smart pointers Contain regular pointers Also contain number of other pointers that are pointing to the object Or do they… –What if an object contains the number of pointers to itself? –Benefits / downsides Designs for this

Pointers Factories In your words, what are they?

Pointers Approache s Function that returns an object Function that takes an object and returns a pointer Function that takes an id and returns a pointer to it Hash map for memory addresses and # of accesses Others?

Pointers Advantages/ Disadvantage s Why use factories? What do they mean for your code? Benefits Downsides

Pointers Flyweight What does the word bring to mind? One object / pointer reused lots and lots of times Similar to NULL except it is a type / pointer What reasons do you think you would use a flyweight object? Benefits / Downsides

Pointers Disk buffer How many GB does a DVD hold? 3 DVD game How does that game load everything into RAM? Or does it load everything into RAM? Memory Mapping to HD idea

Pointers How it works Several blocks of data reserved in memory Each block maps to a unique block on a HD Data is requested, it is loaded from HD –If it is in list, use it, move to MRU position –If it isn’t, load into least recently used block and move it to the MRU position –Linked list of blocks?

Pointers What it enables

Pointers Design patterns Not language specific features Encompasses a particular idea May or may not be heavily supported in a language –Java supports smart pointers by default –C++ requires a separate class Not a silver bullet

Pointers Command pattern Signals when an action needs to be performed Command Central Command Central Contains pointers to objects Contains list of commands Told to execute X, it actually does it

Pointers Summary Memory usage at a higher level