www.ribomation.se Open in urlscan Pro
151.101.65.195  Public Scan

Submitted URL: https://app2.editnews.com/pub/link.ashx?issueid=508388&userid=88300787&linkid=39624355&readid=35E32B60017F&test=&umailid=4...
Effective URL: https://www.ribomation.se/programmerings-kurser/cxx/cxx-memory-constrained-systems/?utm_source=EditNews&utm_medium=email&u...
Submission: On March 25 via api from SE — Scanned from DE

Form analysis 1 forms found in the DOM

<form>
  <h5>Prenumerera på vårt nyhetsbrev</h5>
  <p> Några gånger per månad, skickar vi information om våra kurser och datum samt den senast publicerade artikeln.</p>
  <div class="d-flex w-100 gap-2"><label for="newsletter-email" class="visually-hidden">E-post adress</label> <input type="email" id="newsletter-email" class="form-control" required="" pattern=".+@.+" placeholder="Din e-postadress"> <button
      type="button" id="newsletter-submit" class="btn btn-light">Prenumerera</button></div>
</form>

Text Content

Ribomation
 * Hem
 * Kurser
 * Priser
 * Kontakt
 * Frågor
 * Blog
 * Om...

 1. Hem
 2. Programmerings Kurser
 3. Cxx
 4. Cxx Memory Constrained Systems

Kurs om


C++ FÖR MINNESBEGRÄNSADE SYSTEM


KURS OM HUR DU IMPLEMENTERAR C++ APPLIKATIONER MED EGEN MINNESHANTERING



Denna kurs går på djupet om hur man på olika sätt optimerar och hanterar system
som av olika skäl är minnesbegränsade. Det kan vara inbyggda system eller
transaktionsintensiva system. Kort sagt, programmering av system där
minneshanteringen kräver en alldeles speciell form av omsorg.

Du får lära dig om hur man designar system som inte använder sig av system
heapen. Hur man bygger fler-trådade system med effektiv minneshantering. Hur man
bygger system av processer med delat minne. Hur man fångar och exekverar vidare
efter ett null pekar fel. Hur man kan generera en stack-trace i ett C/C++
program samband med ett kastat undantag. Samt, mycket mer där till.

Välkommen till en spännande och inspirerande fördjupningskurs i Modern C++.






SNABBFAKTA

NAMN

C++ för minnesbegränsade system

ÄMNE

C++ och C

URI

cxx/cxx-memory-constrained-systems

LÄNGD

3 dagar

NIVÅ

Advanced

MÅLGRUPP

Rutinerade C++ programmerare

FÖRKUNSKAPER

Kunna programmera i C++

PROGRAMVARA & VERKTYG

 * GNU C++ Compiler, version 10 or later
 * JetBrains CLion
 * Ubuntu Linux

RELATERADE KURSER

 * CMake för C/C++ byggnation
 * C++ för fler-trådade applikationer
 * Systemprogrammering med Modern C++






KURSDATUM

Här ser du vilka kursdatum som är tillgängliga. Klicka på en av datumknapparna
för att anmäla dig till ett kurstillfälle. På kursen pratar läraren svenska,
medan vårt kursmaterial alltid är författat på engelska.

FJÄRRKURS

Du sitter bekvämt framför datorn och deltar i kursen via internet. Vi använder
programvaran Zoom för alla våra fjärrkurser.

I priset ingår kursmaterial som PDF.

Pris: 15 000 kr + moms

6 april 2022 2 maj 2022 16 maj 2022 8 juni 2022 20 juni 2022

KLASSRUMSKURS

Du sitter bekvämt i ett av våra klassrum, vilka finns centralt placerade i
Stockholms innerstad (Östermalmstorg).

I priset ingår tryckt kursmaterial (och som PDF), samt kaffe/te med smörgås på
förmiddagen och kaffe/te med bulle på eftermiddagen.

Pris: 20 000 kr + moms

Just nu finns det inga datum tillgängligt. Titta förbi om några dagar eller
kontakta oss.

FÖRETAGSANPASSAD KURS

Om ni är tre eller fler personer från samma företags, kan ni beställa en
företagsanpassad kurs. Då håller vi kursen på ett datum som passar er. Antingen
på plats i era lokaler eller som en fjärrkurs. Vi kan också hålla den muntliga
framställningen på engelska. Klicka på knappen nedan för att be om en offert.

Företagsanpassad Kurs






DETTA FÅR DU LÄRA DIG

Här är ett sammandrag i punktform av vad du får lära dig på kursen. Eftersom
kursmaterialet är författat på engelska, så återger vi sammandraget också på
engelska.

 * Be able to use and implement smart pointers
 * Be able to catch a zero pointing error and continue the execution
 * Be able to generate a stack trace in a C / C ++ program
 * Know how to allocate dynamic memory on the stack
 * Be able to implement own memory allocation based on a block pool
 * Be able to implement programs with memory management outside the heap
 * Be able to use PMR (Polymorphic Memory Resource) which was introduced in C ++
   17
 * Be able to implement multi-threaded systems, where each thread has its own
   private heap
 * Be able to implement a program that loads a file into memory with mmap
 * Be able to implement systems with shared memory






KURSINNEHÅLL

Eftersom kursmaterialet är författat på engelska, så återger vi innehållet också
på engelska.





BRIEF ABOUT MODERN C++

Just a quick recap of some topics from newer C++ which are essential for this
course.

 * The new initialization syntax
 * Default initialization
 * Initialization trivial/primitive types
 * Initialization of STL containers
 * Type safety
 * Automatic type inference, usage of auto
 * For-each loops
 * Functions with auto return type
 * Multi-assignment, aka structured bindings
 * Lambda expressions
 * Captures by value and by reference
 * Modern type aliases

UNDERSTANDING RAII

Discussion of the idiom Resource Acquisition Is Initialization and how important
it is for memory management.

 * Principles of the idiom
 * Implementation of a trace class
 * Other examples of RAII

USAGE OF NEW & DELETE

Discussion of usage of new & delete, to lay the groundwork for the rest of the
course.

 * Allocation of a single object
 * Disposing a single object
 * When the heap become full, how to detect it
 * Registering a heap-full hook
 * Allocation of an object array
 * Disposing an object array
 * The hidden secret of an object array, or how can delete [] ptr invoke the
   destructor of all objects
 * Placement new operator, the third form of new
 * Usage of the placement new operator
 * Overloading the new & delete operators
 * Non-throwing version of the new operator

SMART POINTERS

Understand how to implement smart pointers and what is supported in Modern C++.

 * What is a smart pointer, anyway
 * A simple (incomplete) implementation
 * To delete or not to delete; that’s the question
 * Different pointer semantics
 * Single reference semantics using MonoPtr
 * Copy semantics using ClonePtr
 * Reference count semantics using MultiPtr
 * Complete implementation of MonoPtr
 * Implementation of a factory function for MonoPtr
 * Smart pointer support in C++11
 * Using std::unique_ptr
 * Using std::shared_ptr
 * Using a custom deleter
 * Using a free deleter for malloc allocated memory blocks
 * Understanding usage of std::weak_ptr

ADDRESS SPACE ORGANIZATION

Understand where various data blocks get allocated in *NIX like systems.

 * Virtual memory pages
 * Page table
 * Address translation
 * Page fault
 * Compiled program code: the text area
 * Global static data: the data and bss areas
 * Dynamic data: the system heap
 * Local data: the call-stack
 * Organization of a single stack-frame
 * How a function call is performed on assembly level
 * Memory mapped data segments
 * C++ name mangling
 * Demangling linker names
 * Useful system commands such as size, nm, objdump, ldd, lsof
 * Useful online resources, such as cppinsights.io and compiler explorer
 * Classification of embedded systems

UNDERSTANDING ALIGNMENT

Brief discussion of byte alignment and its support in C++.

 * What is alignment
 * The problem with unaligned memory access
 * What is a cache line and how that is related to alignment
 * Cache levels: L1, L2 and L3
 * Understanding array allocation and alignment
 * How the order of members within a struct (or class) affects padding and hence
   the struct size
 * Explicit alignment
 * Alignment of heap allocated objects

UNDERSTANDING THE SYSTEM HEAP

Discussion of the system heap.

 * Allocation functions in std libc
 * Allocation functions in *NIX OS, usage of brk() and sbrk()
 * How the malloc and free usually are implemented
 * Dealing with heap overflow
 * Allocation of very large memory blocks
 * Understanding usage of MMAP_THRESHOLD and how to configure using mallopt
 * What is a memory leak
 * Working with valgrind on the command-line and within JetBrains CLion

USAGE OF EXCEPTIONS

Deep-dive discussion of exceptions in C++.

 * Simple usage of exceptions
 * Catching different types
 * Marking a function as not throwing
 * Automatic destruction of local objects
 * Tracing exception throw
 * Usage of std exceptions, why you should always do that
 * How to reveal the type of unknown exception
 * Exceptions in terms of setjmp() and longjmp()
 * Throwing an exception from a signal handler
 * How to recover from a null pointer crash (SIGSEGV ) and carry on executing
 * Usage of an alternate signal stack
 * Dealing with system errors in *NIX OS
 * Brief discussion of how exceptions really is implemented in modern systems
 * How to disable exception is you must to

UNDERSTANDING RTTI

Deep-dive into RTTI, demangling and how to generate stack-traces in C++.

 * RTTI - Run-Time Type Identification
 * Usage of the typeid operator
 * How to disable RTTI, if you need to
 * Understanding C++ (link) name mangling
 * How to suppress name mangling
 * Programmatic de-mangling, for the Itanium ABI
 * Implementation of C++ demangle function
 * Principles of generating a stack-trace in C/C++ program
 * Complete implementation of stack-traces in C++ with unit tests in Catch2
 * Dealing with application exceptions
 * Dealing with system error exceptions
 * Dealing with crash exceptions and generate a stack-trace for a null pointer
   bug

DEALING WITH TEXT STRINGS

Short recap of the string support in Modern C++.

 * Understanding std::basic_string
 * String literals
 * Raw strings
 * What is SSO (Short String Optimization)
 * Usage of string_view and why it’s a really nice addition to the library

MEMORY BEHAVIOUR OF STL CONTAINERS

Understanding of happens behind the curtains of STL containers.

 * The STL architecture
 * Overview of algorithms
 * What is a STL interval
 * Sequence containers
 * Associative containers
 * Binary tree vs. hash table implementations
 * Tracing new & delete usage
 * Understanding the allocation behaviour of std::vector
 * Why invoking reserve() is an excellent idea
 * Understanding the key difference between copy insertion and in-place
   insertions
 * Investigating the memory usage of emplace_back()

STACK ALLOCATED MEMORY

The heap is not the only place to allocate data, here we discuss how to use the
stack dynamic memory allocation.

 * Memory allocation outside the system heap
 * Using a stack-allocated buffer
 * Understanding RVO (Return Value Optimization)
 * Understanding move semantics
 * Allocation of memory blocks on top of the call-stack using alloca()

USER-DEFINED MEMORY ALLOCATION

The moment you start to use areas outside the system heap, you need to implement
your allocation and de-allocation library, in this chapter we show you how.

 * Primary allocation strategies
 * Monotonic allocation
 * Circular allocation
 * Block-pool storage
 * Implementation of a static block pool
 * Limitations of the template system and how that might affect the usage of
   static pools
 * Implementation of a dynamic block pool
 * Using smart pointers with a block pool
 * Implementation of a custom deleter for a block pool
 * Implementation of factory function for a block pool with a deleter

POLYMORPHIC MEMORY RESOURCES

In this chapter we discuss the allocation support added in C++17 and available
since GCC version 9.

 * What is PMR (Polymorphic Memory Resources)
 * Class & function overview
 * Provided memory resource types and allocators
 * Typical usage of a std::pmr::monotonic_buffer_resource with an upstream
   resource
 * STL container support for PMR
 * Usage of a std::vector using a std::pmr::monotonic_buffer_resource
 * Understanding SSO with PMR
 * How to implement your own memory resource
 * Implementation of a cyclic_buffer_resource
 * Understanding how to use std::pmr::unsynchronized_pool_resource
 * Implementation of spy tracing PMR classes
 * Using PMR in you own user-defined types

MULTI-THREADED APPLICATIONS

Brief discussion of the threading support in Modern C++, to serve as the basis
for next chapter.

 * Threading API in C++11
 * Life-cycle methods
 * Several ways of defining the body of a thread
 * Mutex locks
 * Lock guards
 * Deadlock avoiding multi-locks
 * Read-write locks
 * Condition variables
 * Promise and future

MEMORY ALLOCATION IN MULTI-THREADED SYSTEMS

Discussion of how to in practice implement thread private heaps using PMR.

 * Heap implementation in glibc
 * How to support private heaps
 * The minimum amount of code to send some data from one thread to another
   thread
 * Heap storage for messages
 * Implementation of a (blocking) message queue
 * A simple generic message type
 * Implementation a producer-consumer threaded system, using a private PMR based
   heap for incoming messages
 * Implementation of a more complex message sending pipeline of threads, all
   using PMR based private heaps
 * How to configure the stack-size in POSIX Threads

SHARED MEMORY

Discussion of memory-mapped file and how to create a shared memory segment.

 * How is memory-mapped I/O working
 * Understanding mmap(), munmap() and msync()
 * Implementation of class MemoryMappedFile
 * What is shared memory and how is it working
 * How to create a SHM file and map it into the virtual address space
 * Usage of shm_open() and shm_unlink()
 * Understanding fork() and wait()
 * Implementation of class SharedMemory

MEMORY ALLOCATION IN MULTI-PROCESS SYSTEMS

Discussion of memory allocation and synchronization in shared memory between two
processes.

 * Why C++11 threading types cannot be used in shared memory
 * Implementation of simple C++ wrappers around the POSIX Thread C API
 * Configuration of mutex and condition variables for usage in shared memory
 * A simple demo of a producer-consumer via shared memory using a static message
   queue
 * Demo of a client server system using dynamic memory allocation of messages in
   shared memory

RIBOMATION AB

 * info@ribomation.se
 * +46 (0)730-866-040
 * www.ribomation.se
 * Östermalmstorg 1, 114 42 Stockholm, SWEDEN
 * 

PRENUMERERA PÅ VÅRT NYHETSBREV

Några gånger per månad, skickar vi information om våra kurser och datum samt den
senast publicerade artikeln.

E-post adress Prenumerera

© 2009–2022 Ribomation AB. All rights reserved.

 * 
 * 
 * 
 * 

Prenumeration / Subscription
Tackar för att du anmält dig till vårt nyhetsbrev. / Thank you for signing up to
our newsletter.