Home c++ Good memory book in C++

Good memory book in C++

Author

Date

Category

I am looking for a good book or a series of articles that would describe the various nuances of working with memory in C++ (in some aspects, the language may not matter, but focusing on this programming language). I would like to know how “under the hood” works memory allocation, storage of objects and data in memory.

Question Description is quite blurry. I give an example of questions that interest me:

  1. When the New / Delete is called as the program / OS stores information about the selected memory areas. As a virtual address space relates to a real address space.
  2. What is the class in memory. And if the class is inherited from two other classes with virtual functions.
  3. Exceptions in designers / destructors and features for multi-threaded applications. EXCEPTION is implemented at low level.
  4. Optimization of memory allocation. Own memory allocator.
  5. Creating / deleting objects in a program with multiple modules.

Perhaps these questions will be reflected in different books, I will be glad anyone. What about the specifics of the OS and different compilers: any options are interesting.


Answer 1, Authority 100%

About memory allocation mechanisms, streams and interprocess / interpotional synchronization It is necessary to read books on the operating system device. Can be recommended:

Description of the implementation of the principles of operation of operating systems can be read in Love. Linux kernel: Description of the development process and Labrosse. μC / OS-II:
THE REAL-TIME KERNEL

The memory distribution algorithms also describe in aho, hopcroft , Ulman. Data structures and algorithms

Writing your memory dispenser is discussed in Joshttith. Standard C++ Library: Reference Guide . Also, this question will be affected by Kernigan, Ritchie. Programming language C

Development of multi-threaded applications on C++ 11 The book Williams. Parallel C++ programming in action

There is also a book about the “internal device” C++: Lippman, Inside The C++ Object Model . She is quite old – it is possible that not all the topics of interest are described there.


Answer 2, Authority 114%

one book covering all this, of course, – no.

On the first question you can read STRUCTURED COMPUTER ORGANIZATION and Modern Operating Systems

on the second book is unlikely, because The area is very specific and subject to change, it is better to look for articles here. I have two articles on this topic: Placement of objects. Part 1: Basics and Placing objects. Part 2: Virtuality

On the third issue of books, you do not need to read: the exceptions in the designer is normal, the destructor exception should not leave. By default, with C++ 11, the exception that will leave the destructor will call STD :: TERMINATE and the application will be completed. Multipleness has no relation to the destructor or to the constructor. They cannot be simultaneously implemented in different threads (unless of course cause them clearly for the global object, but it is exotic)

On the fourth issue, the same Tannenbaum, the aforementioned, for general development, and then articles on the Internet. But you do not want to write your own alloctor, though. This is a good video along allocators, from Alexandrescus. And here a piece of book (Supplementary Chapter) from one wonderful author, I did not read this app to the book, but read the main book – author Everything is very well described. True in English, and video and book.

Fifth question: also need to look for articles on the Internet. In short: if you do not want to have a headache, it is better to free memory through the same module that it highlighted it.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions