[zeromq-dev] patch: handle idle connections

Martin Sustrik sustrik at fastmq.com
Sat Apr 11 20:48:01 CEST 2009


Hi Dhammika,

I was trying to merge in your O(1) scheduler and in the process of doing 
so I've found one more place where the complexity is still O(n):

+void zmq::mux_t::revive (pipe_t *pipe_)
+{
+    //  Revive an idle pipe.
+    for (pipes_t::size_type i = pipes.size (); i-- > active; ) {
+        if (pipes [i] == pipe_) {
+            std::swap(pipes [i], pipes [active]);
+            ++active;
+            return;
+        }
+    }

We should convert the pointer into array index in constant time somehow.

Any ideas?
Martin

Dhammika Pathirana wrote:
> On Mon, Mar 30, 2009 at 12:45 AM, Martin Sustrik <sustrik at fastmq.com> wrote:
>> Dhammika,
>>
>> Great! We'll give it a try on all the different platforms. We'll do some
>> performance tests as well (1,10,100,1000,10000 idle connections + ping-pong
>> latency test). However, it won't get into version 0.6 as that one is already
>> closed for new functionality.
>>
>> Also, we need you to state that the patch is submitted under MIT license to
>> be able to merge it into the trunk.
>>
> 
> 
> Sure, patch is submitted under MIT license.
> 
> Dhammika




More information about the zeromq-dev mailing list