Astobj2 Joshua Colp, Senior Software Developer 1 1.

Slides:



Advertisements
Similar presentations
EENG212 Algorithms and Data Structures
Advertisements

Lists and the Collection Interface Chapter 4. Chapter Objectives To become familiar with the List interface To understand how to write an array-based.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
Memory Management. History Run-time management of dynamic memory is a necessary activity for modern programming languages Lisp of the 1960’s was one of.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Sets and Maps Chapter 9. Chapter 9: Sets and Maps2 Chapter Objectives To understand the Java Map and Set interfaces and how to use them To learn about.
Lists and the Collection Interface Chapter 4. Chapter 4: Lists and the Collection Interface2 Chapter Objectives To become familiar with the List interface.
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
File System Implementation
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
Copyright 2001 Oxford Consulting, Ltd1 January Storage Classes, Scope and Linkage Overview Focus is on the structure of a C++ program with –Multiple.
Copyright © 2002, Systems and Computer Engineering, Carleton University Hashtable.ppt * Object-Oriented Software Development Unit 8.
Use of Coverity & Valgrind in Geant4 Gabriele Cosmo.
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.
Module 4.0: File Systems File is a contiguous logical address space.
CE Operating Systems Lecture 17 File systems – interface and implementation.
CSS446 Spring 2014 Nan Wang.  To understand the implementation of linked lists and array lists  To analyze the efficiency of fundamental operations.
ENEE150 – 0102 ANDREW GOFFIN Project 4 & Function Pointers.
Introduction to Object-Oriented Programming Lesson 2.
Chapter 12: Programming in the Large By: Suraya Alias 1-1.
SCALING AND PERFORMANCE CS 260 Database Systems. Overview  Increasing capacity  Database performance  Database indexes B+ Tree Index Bitmap Index 
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
Sets and Maps Chapter 9. Chapter Objectives  To understand the Java Map and Set interfaces and how to use them  To learn about hash coding and its use.
MEMORY MANAGEMENT Operating System. Memory Management Memory management is how the OS makes best use of the memory available to it Remember that the OS.
LINKED LISTS.
Lists and the Collection Interface Chapter 4. Chapter 4: Lists and the Collection Interface2 Chapter Objectives To become familiar with the List interface.
File-System Management
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Memory Management.
Sets and Maps Chapter 9.
Lecture 6 of Computer Science II
Fundamentals of Programming II Bucket Sort: An O(N) Sort Algorithm
PLM, Document and Workflow Management
Distributed Shared Memory
Lectures linked lists Chapter 6 of textbook
Friend Class Friend Class A friend class can access private and protected members of other class in which it is declared as friend. It is sometimes useful.
CSE687 - Object Oriented Design class notes Survey of the C++ Programming Language Jim Fawcett Spring 2004.
CS Data Structures Chapter 8 Lists Mehmet H Gunes
Hashing CSE 2011 Winter July 2018.
Data Abstraction & Problem Solving with C++
Slides by Steve Armstrong LeTourneau University Longview, TX
File System Implementation
Data Structures Interview / VIVA Questions and Answers
Class Operations Pointer and References with class types
Memberwise Assignment / Initialization
Hash Tables in C Louis Manco.
Array Lists Chapter 6 Section 6.1 to 6.3
Fast File Clone in ZFS Design Proposal Pavel Zakharov 11/14/2018.
Chapter 9 Classes: A Deeper Look, Part 1
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Indexing and Hashing Basic Concepts Ordered Indices
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
Destruction and Copying
CS202 - Fundamental Structures of Computer Science II
Advanced Implementation of Tables
Sets and Maps Chapter 9.
Appendix D: Network Model
Union-Find Partition Structures
Destruction and Copying
Classes: A Deeper Look, Part 1
Data Structures and Algorithms Memory allocation and Dynamic Array
Podcast Ch21b Title: Collision Resolution
ENERGY 211 / CME 211 Lecture 17 October 29, 2008.
Rule of Three Part 1 & 2.
Constructors & Destructors
Mr. M. D. Jamadar Assistant Professor
CSE 542: Operating Systems
Presentation transcript:

Astobj2 Joshua Colp, Senior Software Developer 1 1

The Past Previously no consistent full featured object API Basic linked list container existed Inconsistent locking Fragile object destruction 2 2

The Present Reference counted objects Containers (hash or linked list, optional) Iterators Callbacks Container cloning Recommended for new development when applicable Unit tested 3 3

Objects API calls: ao2_alloc, ao2_ref Reference counted (integer stored in object) Destructor callback called when count of 0 is reached Optionally stored in containers Optional locking (mutex, read/write, none) 4 4

Global Objects API calls: ao2_global_obj_release, ao2_global_obj_replace_unref Global storage area for an object Object can be replaced at any time Storage area protected by lock Used by configuration framework 5 5

Containers API calls: ao2_container_alloc, ao2_link, ao2_unlink Bucket size for object distribution User provided hashing callback User provided comparison callback Linked list used for collisions, thus bucket size of 1 is a linked list Is itself a reference counted ao2 object 6 6

Iterators API calls: ao2_iterator_init, ao2_iterator_next, ao2_iterator_destroy Container traversal Does not keep container locked Does not require separate function for logic Must remember to release reference to object Like iterating a linked list 7 7

Callbacks API call: ao2_callback Keeps container locked for each execution Executes function on object(s), can perform matching or general logic Flags to control behavior (unlink if matched, allow multiple objects, key for specific object) Can return object matched 8 8

Finding Objects API call: ao2_find Uses callback internally Can specify a key or pointer to object for comparison Returns object with reference count increased 9 9

Resource Acquisition Is Initialization Macro: RAII_VAR Useful when increasing an object reference count Can decrease reference count automatically when variable goes out of scope Reduces chance of reference count leaks 10 10

Cloning API call: ao2_container_clone Uses callback internally Creates new duplicate container Creates copies of node objects, can be expensive, objects not copied itself 11 11

Potential Problems Reference count leaks, object not getting destroyed Circular references, multiple objects not getting destroyed Inefficient hashing algorithm, decreased performance 12 12

Learn More Include/asterisk/astobj2.h https://wiki.asterisk.org/wiki/display/AST/Refer ence+Count+Debugging Simple example is main/cel.c Used everywhere, though. 13 13