Kurs i

Systems Programming using Modern C++

Hur omvandlar man en signal till en exception? Hur skapar man en process och fyller den med ny programkod. Vilka olika sätt att kommunicera mellan processer finns det? Hur fixar man memory-mapped I/O?

Dessa och en lång rad andra frågeställningar besvarar vi i denna mycket uppskattade kurs.

Detta får du lära dig på kursen
  • Hur adressrummet för en process är organiserad och varför detta är intressant
  • Exakt hur funktionsanrop går till och hur man kan utnyttja den insikten
  • Hur man spårar biblioteksanrop respektive systemanrop
  • Det speciella filssytemet /proc
  • Asynkron I/O och minnesmapapde ditto
  • Signal hantering
  • Hantering av processer med fork & exec och wait
  • Kommuniaktion med pipe & fifo
  • POSIX message queues
  • POSIX shared memory segments
  • POSIX semaphores
  • TCP stream sockets
Innehåll

The Process Concept

  • What is a process and dows it differ from a thread
  • Process meta-data

Virtual Address Space Organization

  • Virtual memory pages
  • Address translation
  • What happens during a page fault
  • Memory areas and their functions

Compilation and Linking

  • Overview of the various compilation steps
  • Understanding the magic number
  • Creating statically linked libraries
  • Creating dynamically linked libraries
  • Using programs to inspect compiled files such as string, nm, objdump, ldd

Understanding Function Calls

  • The call stack
  • The content of stack frames
  • The details of a single function call
  • Implementing variable number of function arguments
  • Using setjmp/longjmp
  • Understanding how longjmp is used when C++ throws an exception

Library and System Calls

  • What is call to a library
  • What is a system call
  • How is the kernel code invoked during a system call
  • Tracing library and system calls

Mmeory Management

  • What is dynamic memory anyway
  • The C and C++ APIs for using the heap
  • Brief about how to implement heap management
  • Estimating the current heap size
  • Implementing a C++ allocator for use with containers
  • Allocating memory blocks on the call stack
  • Tracking memory leaks with valgrind

Creating Processes

  • Copying a process with fork
  • Special process IDs
  • Terminating a process
  • What are zombies and daemons
  • Lobotomate a process with exec

File Systems

  • What is a file system
  • FS types
  • File types
  • Basic operations on files, from the kernel's perspective
  • I-nodes
  • Directory files
  • File descriptors
  • Devices
  • Mounting devices

Regular I/O

  • How to use the kernel API of open/close, read/write
  • Manipulating with files in the file system
  • Using C++ fstream for binary reacord-oriented files

Advanced I/O

  • Manipulation of file descriptors
  • Using memory mapped I/O
  • Implementing class MemoryMappedFile
  • Using non-blocking I/O
  • Using non-deterministic I/O

The /proc File System

  • How the kernel provides a window for you too look into
  • Overview
  • Usage

Signals

  • What are signals
  • Sending signals from the shell and from program code
  • Implementing signal handlers
  • Registering signals and signal masks
  • How to translate a signal, such as SEGV (segmentation fault) into a C++ exception
  • Realizing timeouts
  • Creating interval timers

Channels

  • What is a channel
  • Pipes
  • Fifos
  • Implementing class Fifo

Message Queues

  • What is a message queue and how do it differ from a channel
  • Overview of the API
  • Usages
  • Implementing class MessageQueue

Shared Memory

  • What is shared memory
  • Overview of the API
  • Usages
  • Implementing class SharedMemmory and use it as a C++ allocator

Semaphores

  • What is a semaphore
  • Memory vs file-system based semaphores
  • Overview of the API
  • Usages
  • Implementing class Semaphore
  • Implementing class FileSystemSemaphore
  • Implementing a message queue with semaphores for use in shared memory

TCP Sockets

  • What is a TCP socket
  • API overview
  • Network byte order (NBO)
  • Creating client sockets
  • Implementing class Socket
  • Creating server-side sockets
  • Implementing class ServerSocket
  • Implementing a iostreams compatible socket type
SnabbFakta
Namn
Systems Programming using Modern C++
Längd
3 dagar
Nivå
Advanced
Målgrupp
Erfarna C++ programmerare
Förkunskaper
Vana att programmera i modern C++ 11/14
Teknisk miljö
  • C++14 compliant C++ compiler
  • A decent IDE such as Jetbrains CLion
  • Ubuntu Linux or Cygwin
Relaterade Kurser
KursLängdNivå
Intermediate Modern C++3 dagarIntermediate
Threads Programming using Modern C++3 dagarAdvanced
C++ 11/14 for C++ Programmers2 dagar Intermediate
Modern C++ Basics 5 dagarBeginner
Modern C++ for Java Developers 4 dagarBeginner
Schemalagd Kurs

Pris

16000 kr + moms

Aktuella KursDatum
Startdatum Plats
1 mar 2017Stockholm City
20 mar 2017Stockholm City
24 apr 2017Stockholm City
7 jun 2017Stockholm City
Företagsintern Kurs

Om du beställer en företagsintern kurs kommer vi till er och håller kursen i era egna lokaler. Priset bestäms av vår prismodell och baseras på antalet kursdagar, antalet deltagare, samt i förekommande fall resa och logi.

Prisexempel för NN deltagare

PPP kr + moms

Antal
Område

Läs mer om vår prismodell och beställningsvillkor här .