[DUG] 'Stupid' Dll question

Dennis Chuah dennis_cs_chuah at hotmail.com
Fri Dec 2 09:12:42 NZDT 2005


DLL's are call multi-threaded.  The memory is shared amongst threads of the 
same application and so you will need to use semaphores, etc. to protect 
memory access.  Memory is separate for separate processes.

If you are going to be passing strings to the DLL then you will need to 
include the sharemem unit.

----- Original Message ----- 
From: "Robert martin" <rob at wildsoft.co.nz>
To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
Sent: Friday, December 02, 2005 9:08 AM
Subject: [DUG] 'Stupid' Dll question


> Hi
>
> This might be a stupid question but....  If I create a dll do I have to
> do anything in relation to multi threading?
>
> I have a Dll that has two calls, each call creates and object
> (referenced in a local variable), performs some processing then frees
> the object and returns a result.
>
> How does windows handle multiple apps / threads calling a dll?  Is it
> one virtual instance of the dll per thread or some other scenario?
>
> I know lost of questions but I just want to get it straight in my head.
> We think this dll may be crashing and wonder if it is to do with being
> called by two threads simultaneously.
>
>
>
> Rob Martin
> Software Engineer
>
> phone +64 03 377 0495
> fax   +64 03 377 0496
> web www.chreos.com
>
> Wild Software Ltd
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 


More information about the Delphi mailing list