2002/03/21 01:19:33
[org.ibex.core.git] / src / org / xwt / package.html
diff --git a/src/org/xwt/package.html b/src/org/xwt/package.html
new file mode 100644 (file)
index 0000000..65c3d91
--- /dev/null
@@ -0,0 +1,40 @@
+
+<body>
+
+<p>
+The core XWT engine classes.
+</p>
+
+<h3>Interfacing with other code</h3>
+
+<p>
+This engine is not meant to be used as a library or to interface with
+any other code. Because of this, all classes and methods have package
+(nonpublic) access, except where interpackage calls or reflection
+demand that they be public. Authors of other software should NEVER
+depend on any of these APIs.
+</p>
+
+<h3>An important note about Threads</h3>
+
+<p>
+All operations are single-threaded, except sleep(), yield(), xmlrpc
+calls, and MessageQueue message loop. That means that while one thread
+is rendering or executing a script, no other thread can be rendering
+or executing a script.
+</p>
+
+<p>
+For performance reasons, we do <i>not</i> enforce this
+single-threadedness with Java synchronization primitives. If you
+change the engine code, be very careful not to violate this
+invariant. In general, you should only render or execute JavaScripts
+if (Thread.currentThread() == MessageQueue.singleton). The only
+exception is instances of ThreadMessage -- they include logic to block
+the MessageQueue thread on a semaphore, execute some javascript, and
+unblock the MessageQueue thread once the javascript has returned or
+performed some blocking operation. Be especially careful not to
+manipulate instances of Box from within the AWT thread.  @see
+MessageQueue ThreadMessage
+</p>
+