… | |
… | |
207 | } |
207 | } |
208 | |
208 | |
209 | # Read the message from the Transport Layer |
209 | # Read the message from the Transport Layer |
210 | if (!defined $msg->recv) { |
210 | if (!defined $msg->recv) { |
211 | if ($transport->connectionless) { |
211 | if ($transport->connectionless) { |
|
|
212 | # if we handled very few replies and we have queued work, try |
|
|
213 | # to increase the parallelity as we probably can handle more. |
212 | if ($count < $MIN_RECVQUEUE && @QUEUE) { |
214 | if ($count < $MIN_RECVQUEUE && @QUEUE) { |
213 | ++$MAX_OUTSTANDING; |
215 | ++$MAX_OUTSTANDING; |
214 | kick_job; |
216 | kick_job; |
215 | } |
217 | } |
216 | } else { |
218 | } else { |
… | |
… | |
254 | return; |
256 | return; |
255 | } |
257 | } |
256 | } |
258 | } |
257 | } |
259 | } |
258 | |
260 | |
|
|
261 | # when we end up here, we successfully handled $MAX_RECVQUEUE |
|
|
262 | # replies in one iteration, so assume we are overloaded |
|
|
263 | # and reduce the amount of parallelity. |
259 | $MAX_OUTSTANDING = (int $MAX_OUTSTANDING * 0.9) || 1; |
264 | $MAX_OUTSTANDING = (int $MAX_OUTSTANDING * 0.9) || 1; |
260 | }); |
265 | }); |
261 | } |
266 | } |
262 | |
267 | |
263 | $msg->timeout_id (\(my $rtimeout_w = |
268 | $msg->timeout_id (\(my $rtimeout_w = |