Re: Mail application compiled in Multithread while dll in Singlethread

From: greg (greg_at_malloc.com)
Date: 01/25/05


Date: Tue, 25 Jan 2005 20:10:10 +0200

Thanks Mr. Bogdan,

Since this matter of criticalsection is completely new to me, can you refer
to some example/code how to do it?

Thanks again and all the best.

Greg

"Gabriel Bogdan" <na@na.na> wrote in message
news:OGYzTVvAFHA.2640@TK2MSFTNGP14.phx.gbl...
> If the third party DLL is not multythreaded safe, then use a
criticalsection
> before you make any call to it, and, release it afterwards.
>
> If your aplication is multythreaded you should compile all of it with the
> multythreaded option, but this is not going to solve all the problems for
> you, you still need to sincronize acces to resources shared by diffrent
> threads.
>
> And, as an advice, never take more then 1 critical section at one given
> time, it is possible, but the complexity of the problems raises
> exponencially.
>
>
> "greg" <greg@malloc.com> wrote in message
> news:Ox7eFKvAFHA.3664@TK2MSFTNGP14.phx.gbl...
> > I have a mfc application that compiled in multithread compilation mode.
> > In addition, I have an external library in a form of some dll - I don't
> have
> > its source.
> >
> > I use the external dll in my own dll and I compile it in a single thread
> > mode - otherwise it would crash when its function is called from the mfc
> > application. Problem is that In this situation there is a memory leak.
> >
> > Could this single thread compilation cause the memory leak(recalling the
> the
> > mfc application is compiled in multithread)?
> >
> > Thanks in advance
> >
> > Greg
> >
> >
>
>



Relevant Pages


Quantcast