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 6890837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:19:58+00:00 2026-05-27T06:19:58+00:00

John’s console application calls my DLL function many times (~15x per sec). I am

  • 0

John’s console application calls my DLL function many times (~15x per sec). I am thinking to put this function as a static method.

I know that :

  1. It can only access static props and objects.
  2. It doesn’t need an instance to run the function.

But I don’t know if these are the only questions which i need to ask myself.

Each John’s calls to my function is in a new thread that he creates.

  • If there is an error in my function, how will this affect all other calls?
  • Should I make this function a regular function with instance to the class (which John will create)?
  • What about GC?

What is the best practice answer for this question?

  • 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. Editorial Team
    Editorial Team
    2026-05-27T06:19:58+00:00Added an answer on May 27, 2026 at 6:19 am

    Sounds like there could be a problem. Calling a method which operates on static (shared) objects in a multithread environment should ring some alert bells for you.

    Review your code and if there’s a chance that a shared object is accessed from two (or more) threads at the same time, make the object an instance field and make your methods instance methods.

    Of course, whether or not there is a risk depends much on the actual code (which you don’t show) but making all calls nonstatic means that you lower the potential risk.

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

Sidebar

Related Questions

I was reading John Resig's Secrets of JavaScript Ninja and saw this code: function
I have this string 'john smith~123 Street~Apt 4~New York~NY~12345' Using JavaScript, what is the
I've been using John Resig's getStyle function from Pro JavaScript Techniques to get the
The solution to this question suggested the use of John Resig's class implementation. This
I would like to combo gWidgets(john verzani) with Rgtk2. This could be used by
John Skeets answer to this question, Select all unique combinations of a single list,
I have this JSON file { 1 : { name: John Doe, birthYear: 1990,
I m reading John Resig s Learning Advanced JavaScript http://ejohn.org/apps/learn/#10 and came across this
This is taken from John Resig`s Learning Advanced Javascript #25, called changing the context
This is from John Resig`s Learning Advanced JavaScript #35 http://ejohn.org/apps/learn/#35 , called What happens

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.