Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: about edit box Pin
Hamid_RT4-Jun-06 23:05
Hamid_RT4-Jun-06 23:05 
AnswerRe: about edit box Pin
ThatsAlok5-Jun-06 0:26
ThatsAlok5-Jun-06 0:26 
Questionconfused about system stack Pin
George_George4-Jun-06 22:54
George_George4-Jun-06 22:54 
AnswerRe: confused about system stack Pin
Viorel.5-Jun-06 0:19
Viorel.5-Jun-06 0:19 
GeneralRe: confused about system stack [modified] Pin
George_George5-Jun-06 1:38
George_George5-Jun-06 1:38 
GeneralRe: confused about system stack [modified] Pin
Viorel.5-Jun-06 2:05
Viorel.5-Jun-06 2:05 
GeneralRe: confused about system stack [modified] Pin
George_George5-Jun-06 2:24
George_George5-Jun-06 2:24 
GeneralRe: confused about system stack [modified] Pin
Viorel.5-Jun-06 3:18
Viorel.5-Jun-06 3:18 
Each process has its own "memory space". From one process, you cannot easily access data from another process. As a result, when you use new operator, you obtain a memory fragment which belongs to this process only.

Even if in one process the pointer returned by new operator is, for example, 0x30000, it is possible that another process will get the same value in its new call. But changes made in one process via this pointer do not affect another process. This is because of separated memory spaces. So the 0x30000 address in both processes points to different "physical locations". On microprocessor/system level, there is an automatic procedure for conversion between pointer's values ("virtual address") to "physical address". For instance, the 0x30000 address is converted to the 0x7800000 physical address in the first process, and to 0xAB00000 physical address in the second one, from your, let's say, 1 GBytes of memory.

Also it should be considered that if a process requests more memory that physically is available, then some parts of other processes can be temporary discarded to disk. Probably this is what is called "paging file".

C++ libraries usually are delivered in both versions -- for single-threaded and multi-threaded application. This is for performance reason: single-threaded application does not require redundant synchronization. For instance, there is a version for new operator for single-threading, and another for multi-threading. I just wanted to point that the system functions for single-threading will usually not work in multi-threading mode, so the proper compiler configuration is required in order to avoid heap corruption.

For your own functions, you have to provide your own synchronization. In Windows, there is a series of objects ("critical section", "mutex", etc.) for doing this.
GeneralRe: confused about system stack [modified] Pin
George_George5-Jun-06 3:38
George_George5-Jun-06 3:38 
GeneralRe: confused about system stack [modified] Pin
Viorel.5-Jun-06 3:58
Viorel.5-Jun-06 3:58 
GeneralRe: confused about system stack [modified] Pin
George_George6-Jun-06 19:07
George_George6-Jun-06 19:07 
GeneralRe: confused about system stack [modified] Pin
Viorel.6-Jun-06 20:58
Viorel.6-Jun-06 20:58 
GeneralRe: confused about system stack [modified] Pin
George_George6-Jun-06 21:21
George_George6-Jun-06 21:21 
QuestionQuaternion rotation Pin
lastgen4-Jun-06 22:43
lastgen4-Jun-06 22:43 
Questionhow to structure my program?? Pin
Nawar_nrr4-Jun-06 22:41
Nawar_nrr4-Jun-06 22:41 
AnswerRe: how to structure my program?? Pin
Blake Miller6-Jun-06 5:07
Blake Miller6-Jun-06 5:07 
Questionevent socket model question Pin
followait4-Jun-06 22:14
followait4-Jun-06 22:14 
GeneralRe: Does event socket model have to wait for events in another thread in an interactive app? [modified] Pin
Sarath C4-Jun-06 22:25
Sarath C4-Jun-06 22:25 
GeneralRe: Does event socket model have to wait for events in another thread in an interactive app? [modified] Pin
followait4-Jun-06 22:50
followait4-Jun-06 22:50 
QuestionStrange spin button control problem Pin
David L.S.4-Jun-06 21:33
David L.S.4-Jun-06 21:33 
AnswerRe: Strange spin button control problem Pin
PJ Arends4-Jun-06 21:54
professionalPJ Arends4-Jun-06 21:54 
GeneralRe: Strange spin button control problem Pin
David L.S.4-Jun-06 22:55
David L.S.4-Jun-06 22:55 
QuestionPlease help with recordset Pin
SWDevil4-Jun-06 21:09
SWDevil4-Jun-06 21:09 
QuestionDirectX functions - Graphics card Pin
velayudhan_raj4-Jun-06 21:01
velayudhan_raj4-Jun-06 21:01 
AnswerRe: DirectX functions - Graphics card Please help me, Its URGENT Pin
velayudhan_raj4-Jun-06 22:20
velayudhan_raj4-Jun-06 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.