|
Traditional procedural approach to thread programming is to create a thread and pass it a function to execute. But a function operates on data. The data is most likely shared with other threads. In the object-oriented world data comes first. You create an ActiveObject whose state develops asynchronously. There is a captive thread inside an Active Object, but it's only an implementation detail.
I will describe a C++ implementation of Active Object using Windows API and I will discuss multiple uses of ActiveObject in our own commercial product, including various synchronization techniques.
A similar concept in Java is called the Runnable interface.
|