Application Compatibility Requirements
o
An Application or associated subsystem must not
use the 'INC' instruction as a semaphore without prepending a 'LOCK' prefix.
On a UniProcessor (UP) system this instruction can be used as high performance
semaphore without calling any other OS service if the semaphore is free
and when the semaphore is clear and there are no waiters for the semaphore.
Because the INC instruction can not be interrupted once started and because
the results would be stored in the flags register which are per thread then
it could be used safely as semaphore.
In an OS/2 for SMP V2.11 environment this technique will not work because
it is possible that two or more threads could be executing the same 'INC'
instruction receiving the same results in each processor's/thread's flag
register thinking that they each have the semaphore.
o
Similarly
a 486 or greater instruction such as the CMPXCHG has the same problem above
if a 'LOCK' prefix is not prepended before the instruction.
o
An
Application or associated subsystem which relies on priorities to guarantee
execution of its threads within a process will not work in OS/2 for SMP
V2.11. For example an application may have a time-critical and an idle thread
and may assume that while the time-critical thread is executing that the
idle thread will not get any execution time unless the time-critical thread
explicitly yields the CPU. In an OS/2 for SMP V2.11 environment it is possible
that both the time-critical and idle threads are executing simultaneously
on different processors.
The above compatibility requirements apply only to multithreaded applications,
and therefore do not apply to DOS and WINOS2 applications. However, you
are strongly encouraged to write 32-bit multithreaded applications for better
performance and portability on OS/2 for SMP V2.11.
Given that there is the possibility of some set of applications which may
use one of these techniques, OS/2 for SMP V2.11 provides a mechanism whereby
these multithreaded applications can execute in UP mode. Only one thread
of that process would be allowed to execute at any given time. That thread
could execute on any one of the processors. A utility is used to mark the
EXE file as uniprocessor only. OS/2 forces the process to run in the uniprocessor
mode when the loader detects that the EXE file has been marked as uniprocessor
only. See "The Single Processor Utility Program" section.
[Back: Application Considerations]
[Next: Application Exploitation]