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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:41:40+00:00 2026-05-26T22:41:40+00:00

So I have this 3rd party java library I am using and in the

  • 0

So I have this 3rd party java library I am using and in the documentation it says, not thread safe.

However I just ran it in a separate thread from my UI and it ran fine as expected (otherwise the entire app locks up until everything is finished).

So what can I expect now that I am running a non thread safe library in a thread?

update:

could I run each separate threads for each new class instances of this 3rd party library? or does this mean that I can’t just use more than one thread per class.

Run in thread 1 : ThirdPartyProcessing tpp1 = new ThirdPartyProcessing();
Run in thread 2 : ThirdPartyProcessing tpp2 = new ThirdPartyProcessing();
Run in thread 3 : ThirdPartyProcessing tpp3 = new ThirdPartyProcessing();
  • 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-26T22:41:41+00:00Added an answer on May 26, 2026 at 10:41 pm

    Non-thread safe means that the code does not expect to be called from more than one thread simultaneously. If it is called from two (or more) threads at the same time it will not behave as expected.

    In your case you’re running it from a single thread, which is fine. It is just no the main thread of the app. No problem with that.

    Update

    could I run each separate threads for each new class instances of this 3rd party library? or does this mean that I can’t just use more than one thread per class.

    There’s no definite answer, but usually (non) thread-safety is on an instance-by-instance basis. That is: non-thread safe code does not work well only when two threads access the same instance. Therefore, one thread per instance, as you suggest, will probably work fine.

    The only caveat is that sometime libraries maintain some of their mutable state in static fields which can lead to to inter-thread collision even if each thread accesses a dedicated instance. However, in most libraries this is not the case.

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

Sidebar

Related Questions

Wondering if this is possible. We have an 3rd Party library that contains identification
I have a Java class library (3rd party, proprietary) and I want my python
I have a Java app that needs to integrate with a 3rd party library.
I have a 3rd-party Java library I'm trying to encapsulate in a separate JVM
For my project I have to use a 3rd party Java library which makes
so I have a 3rd party application that I have to interface with, this
I have a getViewBitmap() method that creates a Bitmap with a 3rd party library
I have this string 'john smith~123 Street~Apt 4~New York~NY~12345' Using JavaScript, what is the
I'm trying to integrate a 3rd party library into an existing application; it compiles
There are many java standard and 3rd party libraries that in their public API,

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.