看put的函数注释说明可知,put原本应该被设计为提供这样的能力,
可以在调用者的上下文中被立刻处理,或者在svc的上下文中被处理,
只是出于实际需要,我们很少在调用者的上下文中做处理罢了。
/// A hook method that can be used to pass a message to a
/// task, where it can be processed immediately or queued for subsequent
/// processing in the <svc> hook method.
并且出于某种原因,最终ACE_Task提供的这些本来被设置为protected属性
的函数如putq,getq,最终被设置为public属性,看下面的源代码注释
public: // Should be protected:
// = Message queue manipulation methods.
// = Enqueue and dequeue methods.
回去看了下书,书上的说法是:
Task提供了两种处理模式:passive porcess和active process
passive process是steal the caller's thread,进行处理。然后如果需要进一步active process则调用putq,交给svc,否则不必。
active process 是用户把要处理的信息putq,svc进行getq在new thread中处理。