--- Quote Start ---
The problem I conjectured is independent from how many istructions you have between the OSSemPend and OSSemPost; it's rather caused by the fact you have a higher priority task which runs without never releasing the control to low priority ones.
Since OS-II is a preemptive OS, whenever the high priority task is scheduled just after the semaphore was signaled by the other task, it takes completely the control and runs undisturbed until it reaches the next OSSemPend.
Then inserting more instructions simply delays the time when the event occurs, like in your case (in other words, you need the same number of cycles, but longer time, because each cycle takes longer)
About cout, I agree with dsl: if lot of data is queue for transmission out of jtag uart, your system may run short of stack or heap space.
--- Quote End ---
Thank you, I have understood the first part. Instead I didn't understand the cout problem, because with fflush() I free the buffer. Is not concerned?