[OpenSRF-GIT] OpenSRF branch master updated. 56fa5ed7e9e0aceb4504a5bb279fa626d55a5fc0
Evergreen Git
git at git.evergreen-ils.org
Wed Mar 13 17:39:27 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".
The branch, master has been updated
via 56fa5ed7e9e0aceb4504a5bb279fa626d55a5fc0 (commit)
from 8abac65dac48cc9bbd415741193e3fb873fdbc82 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 56fa5ed7e9e0aceb4504a5bb279fa626d55a5fc0
Author: Bill Erickson <berick at esilibrary.com>
Date: Thu Jan 31 15:05:53 2013 -0500
Block on recv instead of loop/polling in MultiSession
When the time comes to wait for responses to arrive, block on the XMPP
socket (which uses select() under the covers) until data arrives,
instead of looping furiously and calling receive in non-blocking mode.
Before this change, waiting on responses resulted in long-running CPU
spikes.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
diff --git a/src/perl/lib/OpenSRF/MultiSession.pm b/src/perl/lib/OpenSRF/MultiSession.pm
index dd0579c..e196027 100644
--- a/src/perl/lib/OpenSRF/MultiSession.pm
+++ b/src/perl/lib/OpenSRF/MultiSession.pm
@@ -215,17 +215,21 @@ sub request {
sub session_wait {
my $self = shift;
my $all = shift;
+ my $xmpp = OpenSRF::Transport::PeerHandle->retrieve;
my $count;
if ($all) {
$count = $self->running;
while ($self->running) {
+ # block on the xmpp socket until data arrives
+ $xmpp->process(-1);
$self->session_reap;
}
return $count;
} else {
while(($count = $self->session_reap) == 0 && $self->running) {
- usleep 100;
+ # block on the xmpp socket until data arrives
+ $xmpp->process(-1);
}
return $count;
}
-----------------------------------------------------------------------
Summary of changes:
src/perl/lib/OpenSRF/MultiSession.pm | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
hooks/post-receive
--
OpenSRF
More information about the opensrf-commits
mailing list