September 14, 2007 - Castalia 5.2 is now available. Starting at $99 in our online store.

Components LogoThreading Components

These components deal with multi-threading in various ways, like making it easy to write multi-threaded applications or communicating between threads.

TtdThreadWrapper

A component that allows you to just drop the component on the form, implement its OnExecute event handler, and call the Start method to start the thread.

TtdFuture

A sort of thread-based function. You can start the thread normally, and when you call the Value method to get the "function value," it will wait for the thread to finish, so you can start the thread in the background and call the Value method when you need to have the value before continuing.

TtdThreadPool

A component for implementing a simple thread pool. You attach a "work queue" with items to process, add items to the queue, implement the OnProcessWork event handler, and that event handler will be called once for each item in the queue, and it will keep the required number of threads running and processing simultaneously. It's simple because it doesn't require dynamic adjustment of the pool size.

TtdThreadCommunicationsQueue

A thread-safe component that you can push items on and pop items off. Trying to pop an item from an empty queue will suspend the thread trying to do so (or time out, your choice). Trying to push an item onto a full queue will suspend (or time out) the thread trying to do so. Multiple threads can push data into the queue and multiple threads can pop data from the queue.

TtdThreadCommunicationsStream

A component like TtdThreadCommunicationsQueue, except it works like a stream. You can write any number of bytes to into it at one end, and read any number of bytes off of it from the other end. This can theoretically be used with multiple threads as well, but the results are not guaranteed (things like order of bytes, etc...).

TtdCriticalSection

A design-time component for an critical section synchronization object.

TtdEvent

A design-time component for an event synchronization object.

TtdMutex

A design-time component for a mutex synchronization object.

TtdSemaphone

A design-time component for a semaphore synchronization object.

TtdSingleWriterMultipleReaders

A design-time component for SWMR synchronization objects.

TtdThreadButton

A TButton which will execute its OnClick event handler in a thread. Can optionally have a different caption when the thread is running, and can also be used to terminate the thread at that time.

TtdThreadBitBtn

Like TtdThreadButton, but based on TBitBtn.

TtdThreadSpeedButton

Like TtdThreadButton, but based on TSpeedButton.

TtdTCPIPCommunicationsQueueClient

Can be used to connect to a TtdTCPIPCommunicationsQueueServer in a different process and push and pop items with that queue

TtdTCPIPCommunicationsQueueServer

End point of an inter-process communications queue.