Click here to Skip to main content
15,887,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Isolating mathematical functions from an input string Pin
Christian Graus20-Oct-07 16:57
protectorChristian Graus20-Oct-07 16:57 
AnswerRe: Isolating mathematical functions from an input string Pin
KEL322-Oct-07 22:20
KEL322-Oct-07 22:20 
QuestionHow to make a dll re-entrant? Pin
henk21cm20-Oct-07 10:12
henk21cm20-Oct-07 10:12 
AnswerRe: How to make a dll re-entrant? Pin
Abdellatif_El_Khlifi20-Oct-07 11:18
Abdellatif_El_Khlifi20-Oct-07 11:18 
AnswerRe: How to make a dll re-entrant? Pin
Mark Salsbery20-Oct-07 12:55
Mark Salsbery20-Oct-07 12:55 
AnswerRe: How to make a dll re-entrant? Pin
karle20-Oct-07 21:39
karle20-Oct-07 21:39 
GeneralRe: How to make a dll re-entrant? Pin
henk21cm20-Oct-07 23:05
henk21cm20-Oct-07 23:05 
AnswerRe: How to make a dll re-entrant? Pin
knockNrod2-Sep-10 3:10
knockNrod2-Sep-10 3:10 
My understanding is that DLLs are reentrant. That's sort of the idea behind a DLL in the first place. The thread that makes a call into the DLL has its own stack, and since data is not shared between thread stacks, each call has its own data area. However, if you have, for example, a memory mapped file, a named pipe, a resource handle to say a GDI brush, then you have a resource that's shared by the OS across threads. This has nothing to do with the DLL, but accessing that resource inside of the DLL can cause threading issues to arise, since the various callers of the DLL run asynchronously.

For example, suppose your DLL retrieves a handle to brush or writes, reads, then deletes the contents of a memory mapped file. One thread calls into the DLL and, before it exits, is swapped out by the task manager. That thread's stack is set aside and its place of execution within the DLL is marked, then the new thread begins execution. Say the first thread wrote data to the file, but did not read or delete its data. The new thread comes in and writes its data, but when it reads the data back, it gets its data and the data from the previous thread. Then the second thread deletes its data and the data placed there from the previous thread. When the original thread is swapped back in, there is no data there to read back anymore.

A DLL is just a function that is made available to call by any executable (more generally, thread) on the OS.

Disclaimer: I'm not a software engineer, but I play one at my office.
Without darkness, there are no dreams.
-Karla Kuban

Questionfunction name Pin
mauree20-Oct-07 10:11
mauree20-Oct-07 10:11 
AnswerRe: function name Pin
Nemanja Trifunovic20-Oct-07 13:00
Nemanja Trifunovic20-Oct-07 13:00 
GeneralRe: function name Pin
mauree20-Oct-07 13:14
mauree20-Oct-07 13:14 
GeneralRe: function name Pin
Nemanja Trifunovic21-Oct-07 2:40
Nemanja Trifunovic21-Oct-07 2:40 
AnswerRe: function name Pin
Nelek21-Oct-07 20:34
protectorNelek21-Oct-07 20:34 
QuestionCScrollSizes problem: [modified] Pin
Hakan Bulut20-Oct-07 8:45
Hakan Bulut20-Oct-07 8:45 
AnswerRe: CScrollSizes problem: Pin
Nelek21-Oct-07 20:36
protectorNelek21-Oct-07 20:36 
GeneralRe: CScrollSizes problem: Pin
Hakan Bulut21-Oct-07 23:35
Hakan Bulut21-Oct-07 23:35 
GeneralRe: CScrollSizes problem: Pin
Nelek22-Oct-07 4:37
protectorNelek22-Oct-07 4:37 
GeneralRe: CScrollSizes problem: [modified] Pin
Hakan Bulut22-Oct-07 22:00
Hakan Bulut22-Oct-07 22:00 
GeneralRe: CScrollSizes problem: Pin
Nelek29-Oct-07 21:40
protectorNelek29-Oct-07 21:40 
QuestionAbout network status check on local host Pin
Angelfirefox_20-Oct-07 8:10
Angelfirefox_20-Oct-07 8:10 
AnswerRe: About network status check on local host Pin
Hamid_RT20-Oct-07 19:33
Hamid_RT20-Oct-07 19:33 
Questionwhat do u meen by ....... Pin
NawabSahil20-Oct-07 7:03
NawabSahil20-Oct-07 7:03 
AnswerRe: what do u meen by ....... Pin
Steve Echols20-Oct-07 9:24
Steve Echols20-Oct-07 9:24 
AnswerRe: what do u meen by ....... Pin
Rick York20-Oct-07 19:11
mveRick York20-Oct-07 19:11 
AnswerRe: what do u meen by ....... Pin
Hamid_RT20-Oct-07 19:25
Hamid_RT20-Oct-07 19:25 

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.