Well I thought it was pretty darn cool when the man himself responded to my last post about design patterns. (I did notice in Yosifovich’s book some of the memory management explanations where described in terms of a singleton and I imagine there are many other patterns if not called out explicitly, so that answers my question.) Sense yesterday I have busy reading from Windows Internals, Windows System Programming, Johnson Hart and Windows 10 System Programming, Pavel Yosifovich and A little bit of Windows Via C/C++. Mostly what I was reading the past day was the memory management features of Windows. I still don’t understand the difference between reversed and committed memory, because they sound and make me think they are the same thing. I think I understand paging, 4KB or larger blocks of virtual memory stored in the swap/paging file and they page-out and page-in to psychical memory. I noted there was something called a translation lookaside buffer that is some kind of mapping virtual and physical memory that I need to examine more closely. It like in one of the sample application (mini excel), I think they were expending the memory used using the VirtualAlloc functions. Little piece by piece as more cells need more memory. I did notice on the allocation type parameter of VirtualAlloc it has eight bit flags for various options commit and reserve being the first two listed. That made me think of what Steve replied with in my design patterns post, when he said server objects are allocated by the OS and then their pointers are added to a list. It made me think of both VirtualAlloc and HeapAlloc functions. I am wondering if that is what is used for the OS allocation? The DNS Benchmark must use server objects for its list of DNS servers?
I guess with managed languages I never thought about this at this level, I have used constructors and de-constructors in C++ (college, not work). I suppose if one were making use of objects in assembly one would have to allocate room for them as they are needed and then clean that up when finished. Again that makes me think of VirtualAlloc and VirtualFree. So with both HeapAlloc, and VirtualAlloc, VirtualAlloc is more fine grained.
The other stuff I picked up was that win32 is just one (most popular) subsystem of windows. I think it is made up of kernel32.dll, advapi32.dll, user32.dll, gdi32.dll and CSRSS.exe, likely possibly more. I’ve try opening most of these in dependency walker and that is interesting to me. I have also opened NTDLL.dll in dependency walker and the functions are using the naming convention described for the kernel. Very interesting to me.
Chad
I guess with managed languages I never thought about this at this level, I have used constructors and de-constructors in C++ (college, not work). I suppose if one were making use of objects in assembly one would have to allocate room for them as they are needed and then clean that up when finished. Again that makes me think of VirtualAlloc and VirtualFree. So with both HeapAlloc, and VirtualAlloc, VirtualAlloc is more fine grained.
The other stuff I picked up was that win32 is just one (most popular) subsystem of windows. I think it is made up of kernel32.dll, advapi32.dll, user32.dll, gdi32.dll and CSRSS.exe, likely possibly more. I’ve try opening most of these in dependency walker and that is interesting to me. I have also opened NTDLL.dll in dependency walker and the functions are using the naming convention described for the kernel. Very interesting to me.
Chad