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

  • Home
  • SEARCH
  • 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 6247741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:55:53+00:00 2026-05-24T12:55:53+00:00

For an existing java application (which I do not have the source code) I

  • 0

For an existing java application (which I do not have the source code) I am developing a plug-in which is calls a shared library.
Unfortunately this shared library (written in C) is not thread safe.

The application is calling my plugin within several concurrent threads hence the shared library is called by these concurrent threads and naturally it gives many errors due to concurrency ( e.g: already open files are prevented from being opened etc)

I am accessing the shared library via JNA. I even have the source code of this shared library but converting to a thread-safe library will be time consuming and is currently not possible.
Are there other suggested ways to overcome this issue?

All native functions are accessed from only one Java method so I think that making this method synchronized could be the solution. Would you agree?

I have tried this, but unfortunately the issue is not solved. In the log file I still see that the Java method is called concurrently and hence my own efforts to solve this have failed.

  • 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-24T12:55:53+00:00Added an answer on May 24, 2026 at 12:55 pm

    Yes, using synchronization would be a valid solution to this.

    If you do that and still see concurrent access then there are (at least) two possible causes:

    • you don’t always synchronize on the same object (for example your method is synchronized, but it is non-static and called on different objects) or
    • multiple instances of the class with the native call are loaded (actually this is a sub-type of the first one).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an existing application or library in Java which will allow me to
Let's say I have an existing application written in Java which I wish to
Hy, I'm developing a Grails app which has to communicate with an existing Java
I have an existing library (JPhysX) that is a Java wrapper for a native
How do you add a JAR file to an already existing Java library in
The existing application is in C#. During startup the application calls a virtual method
An existing Java site is designed to run under / on tomcat and there
Does anyone know of any existing projects that aim to port Android's Java VM
I want to be able to launch a Java server process from an existing
Existing code is using an asp:repeater to build an HTML table. (emphasis on the

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.