61ca04e3692719c2d0d12498bc5df719e3ee34f9
[org.ibex.core.git] / src / org / xwt / package.html
1
2 <body>
3
4 <p>
5 The core XWT engine classes.
6 </p>
7
8 <h3>Interfacing with other code</h3>
9
10 <p>
11 This engine is not meant to be used as a library or to interface with
12 any other code. Because of this, all classes and methods have package
13 (nonpublic) access, except where interpackage calls or reflection
14 demand that they be public. Authors of other software should NEVER
15 depend on any of these APIs.
16 </p>
17
18 <h3>An important note about Threads</h3>
19
20 <p>
21 All operations are single-threaded, except sleep(), yield(), xmlrpc
22 calls, and MessageQueue message loop. That means that while one thread
23 is rendering or executing a script, no other thread can be rendering
24 or executing a script.
25 </p>
26
27 <p>
28 For performance reasons, we do <i>not</i> enforce this
29 single-threadedness with Java synchronization primitives. If you
30 change the engine code, be very careful not to violate this
31 invariant. In general, you should only render or execute JavaScripts
32 if (Thread.currentThread() == MessageQueue.singleton). The only
33 exception is instances of ThreadMessage -- they include logic to block
34 the MessageQueue thread on a semaphore, execute some javascript, and
35 unblock the MessageQueue thread once the javascript has returned or
36 performed some blocking operation. Be especially careful not to
37 manipulate instances of Box from within the AWT thread.  @see
38 MessageQueue ThreadMessage
39 </p>
40
41 </body>