[Lazarus] Threads and Libraries (dll and so)

Marcos Douglas md at delfire.net
Fri Jan 17 13:25:20 CET 2014


On Fri, Jan 17, 2014 at 8:34 AM, Antonio Fortuny
<a.fortuny at sitasoftware.lu> wrote:
> Hi All.
>
> Maybe not a Lazarus/FPC specific question but development whill be done
> using Lazarus/FPC.
> I wonder if I can build an application (service) having multiple threads
> running (Indy TCP/IP server, multiple connections) and every thread calls
> some functions in a library (dll on Windows, .so on Linux)
> I can imagine that if every thread loads dynamically the library it should
> work as I assume that a library shares its code among all callers (processes
> ?) but each instance has its own data segment tied tp the calling process
> (thread ?).

There will be no problems if the DLL is thread-safe, ie, is better not
use global variables in the DLL.

Marcos Douglas




More information about the Lazarus mailing list