This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
Software incompatibility is a characteristic ofsoftware components orsystems which cannot operate satisfactorily together on the samecomputer, or on different computers linked by acomputer network. They may be components or systems which are intended to operate cooperatively or independently.Software compatibility is a characteristic of software components or systems which can operate satisfactorily together on the same computer, or on different computers linked by a computer network. It is possible that some software components or systems may be compatible in one environment and incompatible in another.
Consider sequential programs of the form:
Requestresource ARequest resource BPerform action using A and BRelease resource BRelease resource A
A particularprogram might use aprinter (resource A) and afile (resource B) in order to print the file.
If several such programs P1,P2,P3 ... operate at the same time, then the first one toexecute willblock the others until the resources are released, and the programs will execute in turn. There will be no problem. It makes no difference whether auni-processor or amulti-processor system is used, as it's the allocation of the resources which determines the order of execution.
Note, however, thatprogrammers are, in general, not constrained to write programs in a particular way, or even if there are guidelines, then some may differ from the guidelines. A variant of the previous program may be:
Request resource BRequest resource APerform action using A and BRelease resource ARelease resource B
The resources A and B are the same as in the previous example – not simplydummy variables, as otherwise the programs are identical.
As before, if there are several such programs, Q1,Q2,Q3 which run at the same time using resources as before, there will be no problem.
However, if several of the Ps are set to run at the same time as several of the Qs, then adeadlock condition can arise. Note that the deadlock need not arise, but may.
P: Request resource AQ: Request resource BQ: Request resource A (blocked by P)P: Request resource B (blocked by Q)...
Now neither P nor Q can proceed1.
This is one kind of example where programs may demonstrate incompatibility.
Another example of a different kind would be where one software component provides service to another. The incompatibility could be as simple as a change in the order ofparameters between the software component requesting service, and the component providing the service. This would be a kind ofinterface incompatibility. This might be considered abug, but could be very hard to detect in some systems. Some interface incompatibilities can easily be detected during thebuild stage, particularly for stronglytyped systems, others may be hard to find and may only be detected atrun time, while others may be almost impossible to detect without a detailed program analysis.
Consider the following example:
Component P calls component Q with parameters x and y. For this example, y may be an integer.
Q returns f(x) which is desired and never zero, and ignores y.
A variant of Q, Q' has similar behaviour, with the following differences:
if y = 100, then Q' does not terminate.
If P never calls Q with y set to 100, then using Q' instead is a compatiblecomputation.However if P calls Q with y set to 100, then using Q' instead will lead to a non-terminating computation.
If we assume further that f(x) has a numeric value, then component Q'' defined as:
Q'' behaves as Q except that if y = 100 then Q'' does not terminate if y = 101 then Q'' returns 0.9 * f(x) if y = 102 then Q'' returns a random value if y = 103 then Q'' returns 0.
may cause problem behaviour. If P now calls Q'' with = 101, then the results of the computation will be incorrect, but may not cause a program failure. If P calls Q'' with y = 102 then the results are unpredictable, andfailure may arise, possibly due todivide by zero or other errors such asarithmetic overflow.If P calls Q'' with y= 103 then in the event that P uses the result in a division operation, then a divide by zero failure may occur.
This example shows how one program P1 may be always compatible with another Q1, but that there can be constructed other programs Q1' and Q1'' such that P1 and Q1' are sometimes incompatible, and P1 and Q1'' are always incompatible.
Sometimes programs P and Q can be running on the same computer, and the presence of one will inhibit the performance of the other. This can particularly happen where the computer usesvirtual memory. The result may be thatdisk thrashing occurs, and one or both programs will have significantly reduced performance. This form of incompatibility can occur if P and Q are intended to cooperate, but can also occur if P and Q are completely unrelated but just happen to run at the same time. An example might be if P is a program which produces large output files, which happen to be stored inmain memory, and Q is an anti-virus program which scans many files on the hard disk. If amemory cache is used for virtual memory, then it is possible for the two programs to interact adversely and the performance of each will be drastically reduced.
For some programs P and Q their performance compatibility may depend on the environment in which they are run. They may be substantially incompatible if they are run on a computer with limited main memory, yet it may be possible to run them satisfactorily on a machine with more memory. Some programs may be performance incompatible in almost any environment.