incubator-lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <mar...@rectangular.com>
Subject Re: [lucy-user] Concurrent searching
Date Wed, 23 Nov 2011 20:35:16 GMT
On Wed, Nov 23, 2011 at 03:56:05PM +0200, goran kent wrote:
> Presumably you're referring to this section in _multi_rpc() which
> needs to change?:
> 
>     my @responses;
>     my $remaining = $num_shards;
>     my $select    = $select{$$self};
>     my $sock_map  = $sock_map{$$self};
>     while ($remaining) {
>         my @ready = $select->can_read;
>         for my $sock ( @{ $ready[0] } ) {
>             my $shard_num = $sock_map->{"$sock"};
>             my $response  = $self->_retrieve_response_from_shard($shard_num);
>             $responses[$shard_num] = $response->{retval};
>             $remaining--;
>         }
>     }
> 

Something like this: 

    my @responses;
    for (my $i = 0; $i < $num_shards; $i++) {
        my $response  = $self->_retrieve_response_from_shard($i);
        $responses[$i] = $response->{retval};
    }

Marvin Humphrey


Mime
View raw message