Design notes

Using a single mover thread

In Concurrent Actors, a single mover thread moves all movable objects. It is possible to use multiple mover threads, but the added complexity involved with coordinating multiple movers and collision detection made this simple scheme more appealing.

Avoiding deadlocks in the mover thread

As a multithread program, Concurrent Actors requires concurrency controls, such as semaphores, introducing the possibility of deadlocks. To avoid deadlocks in the mover thread, this program limits the flow of control between the mover thread and a movable object: control only flows from the thread to the object. With this arrangement, when the mover thread locks its data structures and calls a moving object, the moving object can't make calls back to the thread requiring the reacquisition of the same locks. Movable objects have no knowledge (in the way of pointers or other references) of the mover thread.

Keeping time

The mover thread can be blocked by other threads. If it has been blocked, the mover thread recalculates to account for the lost time. See the implementation of TPeriodicThread::Run.

The mover thread doesn't own movable objects

Movable objects are owned by the Universe subsystem. This higher-level subsystem coordinates the many activities a movable object might be involved in (such as refreshing and colliding).


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker