Discussion:
[omniORB] Non-blocking version of the TCP transport
Serguei Kolos
2008-04-14 16:48:45 UTC
Permalink
Hello

To solve the issue of blocking forever in the tcpConnection::Send
function I have modified
the code in the tcpConnection.cc file to use the TCP sockets in the
non-blocking mode.
The problem is gone now and I have also notices that the new version
saves me some CPU
cycles which is an effect of not calling the 'poll' function for every
'send' or 'recv' as it was before.
For my specific application I gained about 4% of CPU compared with the
original version.
It is of course very much dependent on the operational mode of an
application but I believe
that even in the worst case the non-blocking version should be at least
as fast as the original
one (while I believe that in most practical cases it should be faster).

In case there are no drawbacks of using TCP sockets in non-blocking mode
which I have
overlooked (which very well might be the case) I wander if it would be
possible to apply this
patch to the official omniORB distribution.

Cheers,
Sergei

PS: I have made modifications against omniORB 4.0.7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcpConnection.cc
Type: text/x-c++
Size: 11671 bytes
Desc: tcpConnection.cc
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080414/0ee3883e/tcpConnection.bin
Duncan Grisby
2008-04-20 00:30:58 UTC
Permalink
Post by Serguei Kolos
To solve the issue of blocking forever in the tcpConnection::Send
function I have modified the code in the tcpConnection.cc file to use
the TCP sockets in the non-blocking mode.
[...]
Post by Serguei Kolos
PS: I have made modifications against omniORB 4.0.7
Thanks for that. Do you think you could apply the same changes to the
latest CVS version in the omni4_1_develop branch? That will make it
much easier for me to integrate your changes.

I think it's extremely likely that the use of non-blocking sockets will
fail on some platforms. As such, it would be best to make it an option,
rather than the only case. Do you think you could do that in your
version?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...