
Rebuilding the Demo Host Software
A-20
Why didn't we use display.syncExec() (that is, the blocking version)? The
answer is, we don't want the fileio thread to be blocked on what is a less
important task—updating the widgets—and be less responsive to the
data the target sends. This problem would be compounded if the main
thread happened to be doing a blocking call itself, like rpc.controlStop(),
which exchanges some messages with the target. Then the fileio thread
would unnecessarily wait for that blocking call to complete just so it can
finish updating some not-so-important widget. This is why
display.asyncExec() is the right method to use.
A.4.8
Final Note on JavaScript
One of the strengths of JavaScript is that functions can be defined and
even generated on the fly. Any syntactically valid text can be turned into
a function.
Another strength is that variables can be of any type, and fields in a
structure like hash-table can be added on the fly and be of any type.
These features both carry dangers. Incorrect functions can be
constructed and you won't know until you run them. Also, typos can set a
wrong field or value in a hash-table without any error. Traditional
languages have compilers to prevent some of these errors.
A third powerful feature is the integration of Java classes and ability to
use them easily. Since Java classes could be made to access native
code like driver DLLs, it would not be difficult to create wrapper Java
classes that would call low-level driver functions from a JavaScript script.
A.4.9
Information Resources for ECMAScript (JavaScript) and Libraries
JavaScript programs can readily use Java libraries just by knowing their
APIs. Here are the resources for the libraries used in this application:
JavaScript:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide
Java Networking overview:
http://java.sun.com/docs/books/tutorial/networking/index.html
Java Networking sockets:
http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html
Java File I/O:
http://java.sun.com/docs/books/tutorial/essential/io/
GUI widgets and APIs:
http://www.eclipse.org/swt/widgets/
Programming with SWT:
http://www.developer.com/java/other/article.php/3330861
Содержание TMS320DM6437
Страница 1: ...TMS320DM6437 DVDP Getting Started Guide Literature Number SPRUEV6 July 2007 ...
Страница 20: ...2 8 ...
Страница 34: ...3 14 ...
Страница 40: ...4 6 ...
Страница 63: ......
Страница 64: ...Spectrum Digital Inc 509108 0001B ...