18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction<br />

• Signal 3 is the IWS TimeSlice time period (set to 80ms).<br />

• Signal 4 shows the execution of the thread itself.<br />

Notice that the thread can be executed more than once in the same TimeSlice time period. When the IWS<br />

TimeSlice time period expires, the operating system interrupts the thread execution; however, even though the<br />

IWS Period and TimeSlice parameters are set to 100ms and 80ms respectively, the operating system will not<br />

execute this thread continuously for more than 20ms, because the operating system TimeSlice time period is<br />

set to 20ms.<br />

When the operating system is not executing the Viewer thread, the CPU can execute any other thread<br />

or remain idle (if there are no other active threads to execute). Remember, the IWS Period and TimeSlice<br />

parameters were created to prevent all threads from being active at the same time to prevent 100% CPU<br />

usage.<br />

During thread execution, the thread must handle its pending messages. For example, the Viewer module<br />

must update any related screen objects. If there are no messages pending, the thread deactivates itself and<br />

gives control back to the operating system. The operating system immediately switches to the next active<br />

thread. In other words, a thread can interrupt its own execution — even if the operating system TimeSlice<br />

time period has not yet expired (which occurs frequently in real-world applications).<br />

Note: The Database Spy, DDE Server, LogWin, and ODBC Runtime modules do not have a<br />

TimeSlice parameter. Consequently, after each thread handles all of its pending messages, the<br />

threads become inactive until the next Period message for each one of the threads occurs.<br />

The Background Task is the exception to the execution/switching process just discussed. The mechanism for<br />

executing/switching the Background Task is described in the next section.<br />

<strong>InduSoft</strong> Web Studio Page 27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!