You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2007/08/02 18:41:07 UTC
svn commit: r562179 - in /incubator/qpid/trunk/qpid/cpp/src/qpid:
broker/BrokerQueue.cpp broker/BrokerQueue.h sys/Serializer.cpp
sys/Serializer.h
Author: astitcher
Date: Thu Aug 2 09:41:06 2007
New Revision: 562179
URL: http://svn.apache.org/viewvc?view=rev&rev=562179
Log:
* Changed Broker queue processing to avoid unnecessary uses of boost::bind
* Changed Serializer::execute to take Tasks by reference to avoid overhead of copying
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.h
incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.h
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.cpp?view=diff&rev=562179&r1=562178&r2=562179
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.cpp Thu Aug 2 09:41:06 2007
@@ -49,7 +49,8 @@
next(0),
exclusive(0),
persistenceId(0),
- serializer(false)
+ serializer(false),
+ dispatchCallback(boost::bind(&Queue::dispatch, this))
{
}
@@ -79,7 +80,7 @@
void Queue::process(Message::shared_ptr& msg){
push(msg);
- serializer.execute(boost::bind(&Queue::dispatch, this));
+ serializer.execute(dispatchCallback);
}
@@ -89,13 +90,13 @@
Mutex::ScopedLock locker(messageLock);
messages.push_front(msg);
}
- serializer.execute(boost::bind(&Queue::dispatch, this));
+ serializer.execute(dispatchCallback);
}
void Queue::requestDispatch(){
- serializer.execute(boost::bind(&Queue::dispatch, this));
+ serializer.execute(dispatchCallback);
}
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.h?view=diff&rev=562179&r1=562178&r2=562179
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerQueue.h Thu Aug 2 09:41:06 2007
@@ -75,7 +75,8 @@
std::auto_ptr<QueuePolicy> policy;
QueueBindings bindings;
boost::shared_ptr<Exchange> alternateExchange;
- qpid::sys::Serializer serializer;
+ qpid::sys::Serializer serializer;
+ qpid::sys::Serializer::Task dispatchCallback;
void pop();
void push(Message::shared_ptr& msg);
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.cpp?view=diff&rev=562179&r1=562178&r2=562179
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.cpp Thu Aug 2 09:41:06 2007
@@ -64,7 +64,7 @@
}
}
-void Serializer::execute(Task task) {
+void Serializer::execute(Task& task) {
bool needNotify = false;
{
Mutex::ScopedLock l(lock);
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.h?view=diff&rev=562179&r1=562178&r2=562179
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Serializer.h Thu Aug 2 09:41:06 2007
@@ -66,7 +66,7 @@
* paramater to the constructor was true. Otherwise task will be
* enqueued for execution by a dispatch thread.
*/
- void execute(Task task);
+ void execute(Task& task);
/** Execute pending tasks sequentially in calling thread.
* Drains the task queue and returns, does not block for more tasks.