Design notes

Separating the thread from its state

The Kernel services
provide no way to confirm that a thread, once started, still exists--for good reason. If an object was told a thread existed, by the time the object received that news and began to process it, the thread's status
could change.

If you need to start a thread and manipulate it--as in many multithread programs--you need to create classes separating the thread from its state. An alternative is using IPC services. However, IPC requires microkernel processing which requires additional performance overhead.

Creating a type-safe queue

Although Taligent provides a queue class called TProducerConsumerQueue, this program uses its own class, TPCQueue--a templatized version of TProducerConsumerQueue. Being templatized, TPCQueue provides a type-safe queue, which makes debugging the program easier.


[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