As an example, we provide a simple "compute server" used for ray tracing. A JavaSpacesTM service provides a place for a ray-tracing applet to place parts (or "chunks") of an image that need to be rendered, and for a "worker" applet to look for entries that need to be rendered. The worker(s) will process a chunk, and then return the chunk to the space, so the chunk may be retrieved by the ray-tracing applet.
The Trace Window
When the ray-tracing applet first starts, you will see:
As each piece gets rendered by the worker applet it gets displayed on the screen below.
- Chunk
Allows the user to control how fine or coarse the division of the rendering should be.- Start
Once you decided how big the chunks will be, this button will start populating the space with NxM pieces.- Stop
This button will stop populating the space.The Worker Window
The worker window has three buttons:
The taking and returning of tasks from and to the space are monitored on the panel below the buttons.
- Start
Pressing this button tells the worker to go to the space and look for entries that need to be rendered. If it finds one, it will take it out of the space, render it, and put it back into the space marked as rendered. The trace applet will see the rendered entry, take it, and display the rendered chunk on the screen.- Stop
Pressing this button stops the worker from taking any more entries still needing to be rendered.- Cancel
Pressing this button aborts the entire process.