We present a new pattern for implementing worker threads that is more flexible than traditional patterns. Traditional worker threads receive command messages with enumerated IDs that refer to pre-defined behaviors. In our new pattern, worker threads receive function pointers, and they have only one behavior: invoke the function. In this way, new behaviors can be passed in to the thread at run-time rather than having to be pre-defined. In addition, we present in-place consumption as an improvement for command message queues that reduces the number of times data needs to be copied.
All Science Journal Classification (ASJC) codes
- Information Systems
- Hardware and Architecture
- Computer Networks and Communications