Reproducibility of results of a multithreaded Java application

I

I. Farbe

Hello,

I have inherited a complex multithreaded Java app about a year ago. It
continuously reads input data from a file and updates some data
objects. These data objects are then used by decision-making classes
running on parallel threads. Yet another thread is used to
continuously check the state of the decision-making classes and produce
output based on the combined state.
There were some deadlock issues that I was able to fix. There may
still be some thread contention issues.
My question is following: Assuming that all threading issues are
resolved, is it possible for an application like the one described
above to always produce the same output when given the same input.
As it runs now, the output of the identical runs matches about 85% -
90%, so I am trying to figure out whether the discrepancy is due to yet
uncovered bugs in the system, or if it's an expected Java behavior.

Thank you in advance for any insight
 
J

John C. Bollinger

I. Farbe said:
I have inherited a complex multithreaded Java app about a year ago. It
continuously reads input data from a file and updates some data
objects. These data objects are then used by decision-making classes
running on parallel threads. Yet another thread is used to
continuously check the state of the decision-making classes and produce
output based on the combined state.
There were some deadlock issues that I was able to fix. There may
still be some thread contention issues.
My question is following: Assuming that all threading issues are
resolved, is it possible for an application like the one described
above to always produce the same output when given the same input.
As it runs now, the output of the identical runs matches about 85% -
90%, so I am trying to figure out whether the discrepancy is due to yet
uncovered bugs in the system, or if it's an expected Java behavior.

Given the generality of your actual question, I'd have to say, yes, it's
possible that a program such as you describe could have the property
that it always produces the same output from any given input. That
doesn't actually tell you, however, whether the differences you observe
in the outputs of your /particular/ program are the result of
unidentified bugs. It seems a strange angle from which to approach the
question, though; is not the uniqueness of the solution a characteristic
of the problem the program solves? If there are multiple correct
solutions then your program may be accurately modeling the problem
domain, but if your program produces multiple distinct(*) solutions when
there should only be one then it is clearly buggy.

* Note that solutions that are not identical may nevertheless not be
meaningfully distinct.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top