[Ace-users] [ace-users] Using ACE_Svc_Handler::msg_queue() for buffering is slow

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Fri Nov 2 13:29:00 CDT 2007


Hi,

>I've got a simple class that inherits from ACE_Svc_Handler like so:
>
>class StreamHandler :
>  public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> {
>
>which has a basic method write(buf, bytes) that puts the bytes
>supplied in an ACE_Message_Block and if that fills up it buffers them
>in the message queue. The handle_output method will try to write as
>much to the socket as possible until it has used up all the bytes in
>the queue and buffer, or until the send() command fails (because of
>blocking). If it has sent all bytes it clears the wakeup handler
>WRITE_MASK.

Ok, that makes sense so far.

>If I set the buffer to quite large, say 8192 bytes I can transfer
>100mb through this system in a couple of seconds. 

BTW, what do you mean by "the buffer" - do you mean the ACE_Message_Block?

>Whenever the
>ACE_Message_Queue is used it uses exponentially more time. If I say
>restrict the buffer to 10 bytes for instance it will take 2 minutes to
>transfer 100mb.

Sure, that makes sense since you're going through the Reactor
repeatedly, which will take more time.

Thanks,

Doug
-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list