Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 171415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:59:02+00:00 2026-05-11T12:59:02+00:00

I am writing a server application in Delphi 2009 that implements several types of

  • 0

I am writing a server application in Delphi 2009 that implements several types of authentication. Each authentication method is stored in a separate dll. The first time an authentication method is used the appropriate dll is loaded. The dll is only released when the application closes.

Is it safe to access the dlls without any form of synchronisation between the server threads (connections)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:59:02+00:00Added an answer on May 11, 2026 at 12:59 pm

    Short answer:

    Yes, it is generally possible to call a DLL function from multiple threads, since every thread has it’s own stack and calling a DLL function is more or less the same as calling any other function of your own code.

    Long answer:

    If it is actually possible depends on the DLL functions using a shared mutable state or not.

    For example if you do something like this:

    DLL_SetUser(UserName, Password) if DLL_IsAuthenticated then begin ... end; 

    Then it is most certainly not safe to be used from different threads. In this example you can’t guarantee that between DLL_SetUser and DLL_IsAuthenticated no other thread makes a different call to DLL_SetUser.

    But if the DLL functions do not depend on some kind of predefined state, i.e. all necessary parameters are available at once and all other configuration is the same for all threads, you can assume it’ll work.

    if DLL_IsAuthenticated(UserName, Password) then begin ... end; 

    But be careful: It might be possible that a DLL function looks atomic, but internally uses something, which isn’t. If for example if the DLL creates a temporary file with always the same name or it accesses a database which can only handle one request at a time, it counts as a shared state. (Sorry, I couldn’t think of better examples)

    Summary:

    If the DLL vendors say, that their DLLs are thread-safe I’d use them from multiple threads without locking. If they are not – or even if the vendors don’t know – you should play it safe and use locking.

    At least until you run into performance problems. In that case you could try creating multiple applications/processes which wrap your DLL calls and use them as proxies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a server application that's communication with a local sql server. Each client
I am writing a server-client application. I have a server that holds several sockets
I'm writing a database application that connects to SQL server. I'd like to implement
I'm writing an application that allows users to upload images onto the server. I
I am testing one application that handles files (stored in SQL Server using FILESTREAM
I'm in the process of writing a server application that mainly allows people to
I'm writing a client-server win32 application in Delphi 7 and in a section i
Not really that familiar with Swing, and am writing a client-server UDP chat application.
I am writing a server application that is able to manipulate the DOM before
I am writing a client/server application. I have a Message class with several String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.