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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:20:18+00:00 2026-05-14T07:20:18+00:00

I have a problem with a specific java client library. Here is the situation:

  • 0

I have a problem with a specific java client library. Here is the situation:

I have made a program that uses the library. The program is a class named ‘WorkerThread’ that extends Thread. To start it I have made a Main class that only contains a main() function that starts the thread and nothing else. The worker uses the library to perform comm with a server and get results.
The problem appears when I want to run 2 WorkerThreads simultaneously. What I first did was to do this in the Main class:

public class Main
{
   public static void main(String args[])
   {
      new WorkerThread().start(); // 1st thread.
      new WorkerThread().start(); // 2nd thread.
   }
} 

When I run this, both threads produce irrational results and what is more , some results that should be received by 1st thread are received by the 2nd instead.

If instead of the above, I just run 2 separate processes of one thread each, then everything works fine.

Also:

1.There is no static class or method used inside WorkerThread that could cause the problem. My application consists of only the worker thread class and contains no static fields or methods
2.The library is supposed to be usable in a multithreaded environment. In my thread I just create a new instance of a library’s class and then call methods on it. Nothing more.

My question is this:
Without knowing any details of my implementation, is the above situation and facts enough to prove that there is a bug in the library and not in my programm? Is it safe to assume that the library might for example use a static object or an object shared between library created threads that is indirectly shared by my 2 threads and this causes the problem? If no then in what hypothetical situation could the bug originate in the worker class code?

EDIT: I didnt say the library because i want to know if the facts above can produce an answer to my question independently of the library, but anyway the library is rabbit mq java client. Each thread creates 1 connection and 2 channels and uses one to publish data and one to receive results.

EDIT 2: New fact: Problem seems to depend on the rate at which I send stuff to the queues. Sending in slower rate lowers the amount of wrong results.

  • 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-14T07:20:19+00:00Added an answer on May 14, 2026 at 7:20 am

    I would assume the problem is in the library indeed.

    However, I’d go further, check-out the library sources (or use a decompiler) and see (perhaps using a debugger) what is actually happening.

    That way you will both prove the problem is not in your code & be able to submit a valuable bug-report.

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

Sidebar

Ask A Question

Stats

  • Questions 417k
  • Answers 417k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assume you're missing a join to PRODUCT table? Anyway, this… May 15, 2026 at 9:38 am
  • Editorial Team
    Editorial Team added an answer This works as expected... at least according to the manual… May 15, 2026 at 9:38 am
  • Editorial Team
    Editorial Team added an answer Never store cache data in NSUserDefaults; that is not what… May 15, 2026 at 9:38 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.