<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>计算机－＞网络</title><link>http://blog.vckbase.com/bastet/category/577.html</link><description>计算机－＞网络</description><managingEditor>Diviner</managingEditor><dc:language>zh-CHS</dc:language><generator>.Text Version 0.958.2004.214</generator><item><dc:creator>Diviner</dc:creator><title>FD_SETSIZE在不同操作系统中的行为(From Squid)</title><link>http://blog.vckbase.com/bastet/archive/2006/07/26/21533.html</link><pubDate>Wed, 26 Jul 2006 09:56:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2006/07/26/21533.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/21533.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2006/07/26/21533.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/21533.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/21533.html</trackback:ping><description>&lt;P&gt;1、LINUX下面&lt;BR&gt;Cannot increase FD_SETSIZE on Linux, but we can increase __FD_SETSIZE&lt;BR&gt;with glibc 2.2 (or later? remains to be seen). We do this by including&lt;BR&gt;bits/types.h which defines __FD_SETSIZE first, then we redefine&lt;BR&gt;__FD_SETSIZE. Ofcourse a user program may NEVER include bits/whatever.h&lt;BR&gt;directly, so this is a dirty hack!&lt;BR&gt;&lt;BR&gt;#if (__GLIBC__ &amp;gt; 2) || (__GLIBC__ == 2 &amp;amp;&amp;amp; __GLIBC_MINOR__ &amp;gt;= 2)&lt;BR&gt;#include &amp;lt;bits/types.h&amp;gt;&lt;BR&gt;#undef __FD_SETSIZE&lt;BR&gt;#define __FD_SETSIZE SQUID_MAXFD&lt;BR&gt;#endif&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;2、FreeBsd&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Cannot increase FD_SETSIZE on FreeBSD before 2.2.0, causes select(2)&lt;BR&gt;to return EINVAL.&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;3、Mac OS X Server&lt;BR&gt;&lt;BR&gt;Trying to redefine CHANGE_FD_SETSIZE causes a slew of warnings&lt;BR&gt;on Mac OS X Server.&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;其他的大部分平台基本上都可以重定义FD_SETSIZE（当然包括winnt系列了)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/21533.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>提供ACE(主要是proactor)、网络编程部分的咨询。</title><link>http://blog.vckbase.com/bastet/archive/2006/04/12/19423.html</link><pubDate>Wed, 12 Apr 2006 00:55:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2006/04/12/19423.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/19423.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2006/04/12/19423.html#Feedback</comments><slash:comments>11</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/19423.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/19423.html</trackback:ping><description>rt&lt;img src ="http://blog.vckbase.com/bastet/aggbug/19423.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>转：15,000 Simultaneous Connections</title><link>http://blog.vckbase.com/bastet/archive/2006/01/15/17062.html</link><pubDate>Sun, 15 Jan 2006 03:00:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2006/01/15/17062.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/17062.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2006/01/15/17062.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/17062.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/17062.html</trackback:ping><description>Lincoln Dale wrote:&lt;BR&gt;&lt;I&gt;&amp;gt; in order to be able to handle large numbers of concurrent connections (open &lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; sockets), there are really only two ways of doing it efficiently:&lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; &lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; (1) single process using threads&lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; (2) single process, event-driven queues&lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; &lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; with (1), you have a slightly higher overhead than a well-written (2), &lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; however you can scale to multiprocessor with no additional effort.&lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; &lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt; (2) will always be best, but is typically one of the hardest to code for.&lt;/I&gt;&lt;BR&gt;&lt;I&gt;&amp;gt;&lt;/I&gt;&lt;BR&gt;
&lt;P&gt;Whether (2) is best or not depends upon the kernel interface. If a&lt;BR&gt;scan of 15,000 file descriptors is required for each event (such as&lt;BR&gt;a straightforward design based on select()) then (2) could be nearly&lt;BR&gt;as bad as a naive accept()/fork() model, while a thread-per-connection&lt;BR&gt;model might scale better. If the kernel somehow passed an event list&lt;BR&gt;to the server process more efficiently than via select() or poll(),&lt;BR&gt;then I would agree that (2) is probably always the better way, perhaps&lt;BR&gt;with extensions into a thread-per-processor regime on SMP's.&lt;BR&gt;
&lt;P&gt;Achieving the best efficiency involves coupling the arrival of a packet&lt;BR&gt;to the object (explicit or implicit) handling that particular connection&lt;BR&gt;in the most direct way possible, modulo buffering. Eliminating linear&lt;BR&gt;searches from that coupling is important--a scan of 15,000 descriptors&lt;BR&gt;is going to be a significant hit, no matter what other efficiencies are&lt;BR&gt;involved, since it is O(n^2) (where n is the number of connections). This&lt;BR&gt;is why a threaded model might work better for large numbers of connections,&lt;BR&gt;assuming that thread scheduling is better than O(n^2). (Is it?)&lt;BR&gt;
&lt;P&gt;I've actually implemented high-efficiency servers based on a combination&lt;BR&gt;of (1) and (2); in essence, a small pool of threads each handling a number&lt;BR&gt;of connections using an event-based model. At least for my project (which&lt;BR&gt;involved high connection rates more than large numbers of sustained&lt;BR&gt;connections), one or two threads per processor seemed to be the most&lt;BR&gt;efficient configuration--but this was under Solaris, not Linux, though&lt;BR&gt;I certainly was able to achieve good performance (&amp;gt;1000 connects/second&lt;BR&gt;on a UP P2/333) on the latter in tests.&lt;BR&gt;
&lt;P&gt;Just another data point.&lt;BR&gt;
&lt;P&gt;-Ed&lt;BR&gt;
&lt;P&gt;
&lt;P&gt;
&lt;P&gt;-&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/17062.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>ICE，你真的比CORBA要快吗？(转NEWGROUP上的贴子)</title><link>http://blog.vckbase.com/bastet/archive/2006/01/03/16775.html</link><pubDate>Tue, 03 Jan 2006 11:47:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2006/01/03/16775.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/16775.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2006/01/03/16775.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/16775.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/16775.html</trackback:ping><description>&lt;STRONG&gt;&lt;FONT size=4&gt;&amp;nbsp;omniORB and Ice performance compared&lt;/FONT&gt;&lt;/STRONG&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 8px; PADDING-TOP: 0px" vAlign=baseline&gt;关于此主题的全部 &lt;B&gt;7&lt;/B&gt; 个帖子 - &lt;A href="http://groups.google.com/group/comp.object.corba/browse_frm/thread/1106eb2c0ae4bc41?tvc=1&amp;amp;q=ice"&gt;&lt;FONT color=#0000cc&gt;树式浏览&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;SCRIPT language=javascript1.2&gt;&lt;!--
function mm( txtarea ) {
  txtarea.rows = 10;
  sizeLeftNav();
}

//--&gt;&lt;/SCRIPT&gt;
&lt;!-- &lt;a name="dcc3468b0c5e1ef8e"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropenedcc3468b0c5e1ef8e cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Duncan Grisby &lt;duncan-n...@grisby.org&gt;" noWrap bgColor=#b71c0c&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Duncan Grisby&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年11月22日 下午8时12分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=occ3468b0c5e1ef8e onclick="return op('cc3468b0c5e1ef8e');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=hcc3468b0c5e1ef8e&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;Duncan Grisby &amp;lt;duncan-n&lt;A href="http://groups.google.com/groups/unlock?msg=cc3468b0c5e1ef8e&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@grisby.org&amp;gt;&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=rqdcHBYAAACyE8WlKylbN75GL_Em8LaJUp0JC01PZ6IVc77xtmNqIQ&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;Tue, 22 Nov 2005 12:12:55 GMT&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年11月22日(星期二) 下午8时12分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=cc3468b0c5e1ef8e&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=cc3468b0c5e1ef8e&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/cc3468b0c5e1ef8e?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/cc3468b0c5e1ef8e" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/cc3468b0c5e1ef8e?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2Fcc3468b0c5e1ef8e" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbodycc3468b0c5e1ef8e&gt;
&lt;P&gt;&lt;A name=msg_cc3468b0c5e1ef8e&gt;&lt;/A&gt;Hi, &lt;BR&gt;
&lt;P&gt;At the risk of further fanning the flamewar, I thought I would do some &lt;BR&gt;performance comparisons between &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB. ZeroC make a big deal &lt;BR&gt;out of &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice's&lt;/B&gt; performance -- it's mentioned before anything else in the &lt;BR&gt;description of &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; on the ZeroC web site -- so it's good to see how it &lt;BR&gt;really performs. I don't want to imply that performance is the only &lt;BR&gt;important thing -- whether &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; is better or worse than CORBA in other &lt;BR&gt;respects is a separate issue. &lt;BR&gt;
&lt;P&gt;To do the comparison, I used the latency and throughput demos from the &lt;BR&gt;&lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; distribution. It didn't take much modification to turn them into &lt;BR&gt;CORBA programs. &lt;BR&gt;
&lt;P&gt;The performance tests were done on a machine with an Intel Pentium 4 &lt;BR&gt;3.2 GHz hyper-threaded processor, running Fedora Core 3 Linux. Both &lt;BR&gt;&lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB were compiled with g++ 3.4.4, with the -O3 &lt;BR&gt;optimisation level. The tests run on a single machine, between two &lt;BR&gt;processes. I have only tested C++ so far. I might do some Python &lt;BR&gt;comparisons later. &lt;BR&gt;
&lt;P&gt;I used the latest stable releases of &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB: 3.0.0 and 4.0.6 &lt;BR&gt;respectively. &lt;BR&gt;
&lt;P&gt;Both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB are run with no special configuration, so they &lt;BR&gt;use the default options for everything. For omniORB, I tried both the &lt;BR&gt;default TCP transport and the Unix domain socket transport. &lt;BR&gt;
&lt;P&gt;So, the results: &lt;BR&gt;
&lt;P&gt;The latency test just pings an object. I ran each test three times and &lt;BR&gt;picked the best result: &lt;BR&gt;
&lt;P&gt;&amp;nbsp; &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; tcp: &amp;nbsp; &amp;nbsp; &amp;nbsp;time for 100000 pings: 6926.86ms &lt;BR&gt;&amp;nbsp; omniORB tcp: &amp;nbsp;time for 100000 pings: 4566.58ms &lt;BR&gt;&amp;nbsp; omniORB unix: time for 100000 pings: 2373.28ms &lt;BR&gt;
&lt;P&gt;omniORB is over 1.5 times faster using TCP, and more than 2.9 times &lt;BR&gt;faster using Unix sockets. &lt;BR&gt;
&lt;P&gt;The throughput test looks at the time taken to transfer large &lt;BR&gt;sequences of various types. Each type is tested four ways: sending as &lt;BR&gt;an argument, sending oneway as an argument, receiving as a return &lt;BR&gt;value, and echoing. &lt;BR&gt;
&lt;P&gt;The values shown are a throughput in MBit/s, calculated by the test. &lt;BR&gt;Larger numbers are better. &lt;BR&gt;
&lt;P&gt;Test &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;omniORB tcp &amp;nbsp; omniORB unix &lt;BR&gt;
&lt;P&gt;byte sequence &lt;BR&gt;&amp;nbsp; send &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1180.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2433.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4788.8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;BR&gt;&amp;nbsp; oneway &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1321.0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2504.5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4267.8 &lt;BR&gt;&amp;nbsp; return &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 777.5 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1184.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1554.3 &lt;BR&gt;&amp;nbsp; echo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 950.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1501.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2250.3 &lt;BR&gt;
&lt;P&gt;string sequence &lt;BR&gt;&amp;nbsp; send &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;78.8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 82.9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;86.7 &lt;BR&gt;&amp;nbsp; oneway &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;81.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 83.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;88.8 &lt;BR&gt;&amp;nbsp; return &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 52.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;53.6 &lt;BR&gt;&amp;nbsp; echo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;66.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 64.4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;67.9 &lt;BR&gt;
&lt;P&gt;struct: string and double &lt;BR&gt;&amp;nbsp; send &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 178.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;186.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 210.5 &lt;BR&gt;&amp;nbsp; oneway &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 181.4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;193.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 211.7 &lt;BR&gt;&amp;nbsp; return &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 129.0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;121.9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 130.9 &lt;BR&gt;&amp;nbsp; echo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 145.8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150.0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 159.9 &lt;BR&gt;
&lt;P&gt;struct: two longs and a double &lt;BR&gt;&amp;nbsp; send &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 611.4 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1301.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2118.0 &lt;BR&gt;&amp;nbsp; oneway &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 567.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1310.0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2059.1 &lt;BR&gt;&amp;nbsp; return &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 486.7 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1052.0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1520.8 &lt;BR&gt;&amp;nbsp; echo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 545.8 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1159.4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1758.5 &lt;BR&gt;
&lt;P&gt;As you can see, omniORB mostly beats &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt;, With fixed length types, it &lt;BR&gt;beats it significantly. &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; wins on a couple of the string sequence &lt;BR&gt;tests and one of the tests with a struct containing a string and a &lt;BR&gt;double. &lt;BR&gt;
&lt;P&gt;I think the results with strings are more an artifact of the way the &lt;BR&gt;tests work than anything else. All the tests pre-build the sequences &lt;BR&gt;they are going to transfer. &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; sensibly uses C++ standard strings to &lt;BR&gt;represent the strings; CORBA just uses C-style char* arrays (plus &lt;BR&gt;holder objects for deallocation). Constructing a C++ string is more &lt;BR&gt;expensive than constructing a C string, but once it has been &lt;BR&gt;constructed its length has been pre-calculated. Marshalling a sequence &lt;BR&gt;of existing C++ strings therefore only requires one pass over each &lt;BR&gt;string, while C-style strings require two passes. In a real &lt;BR&gt;application, the strings would probably be constructed during &lt;BR&gt;operation of the program, rather than right at the start, so I'm not &lt;BR&gt;sure this difference would appear in many real situations. &lt;BR&gt;
&lt;P&gt;I hope some people find this interesting. &lt;BR&gt;
&lt;P&gt;Cheers, &lt;BR&gt;
&lt;P&gt;Duncan. &lt;BR&gt;
&lt;P&gt;-- &lt;BR&gt;&amp;nbsp;-- Duncan Grisby &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- &lt;BR&gt;&amp;nbsp; -- dun&lt;A href="http://groups.google.com/groups/unlock?msg=cc3468b0c5e1ef8e&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@grisby.org &amp;nbsp; &amp;nbsp; -- &lt;BR&gt;&amp;nbsp; &amp;nbsp;-- &lt;A href="http://www.grisby.org/" target=_blank&gt;&lt;FONT color=#0000cc&gt;http://www.grisby.org&lt;/FONT&gt;&lt;/A&gt; -- &lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;A id=anchor_7793e54647b80317 name=7793e54647b80317&gt;&lt;/A&gt;&lt;BR&gt;&lt;!-- &lt;a name="d7793e54647b80317"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropened7793e54647b80317 cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Siegfried Rohdewald &lt;i...@rayfract.com&gt;" noWrap bgColor=#005a9b&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Siegfried Rohdewald&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年11月25日 下午7时22分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=o7793e54647b80317 onclick="return op('7793e54647b80317');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=h7793e54647b80317&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;"Siegfried Rohdewald" &amp;lt;i&lt;A href="http://groups.google.com/groups/unlock?msg=7793e54647b80317&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@rayfract.com&amp;gt;&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=7thC1xEAAAAItl4D09No2pBkEmsIzzTckdEasx1kiYTQavV7mdW13Q&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;25 Nov 2005 03:22:57 -0800&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年11月25日(星期五) 下午7时22分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;Re: omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=7793e54647b80317&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=7793e54647b80317&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/7793e54647b80317?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/7793e54647b80317" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/7793e54647b80317?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2F7793e54647b80317" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbody7793e54647b80317&gt;
&lt;P&gt;&lt;A name=msg_7793e54647b80317&gt;&lt;/A&gt;
&lt;DIV class=qt id=qhide_21809 style="DISPLAY: block"&gt;Duncan Grisby wrote: &lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;... &lt;BR&gt;
&lt;P&gt;
&lt;DIV class=qt id=qhide_21810 style="DISPLAY: block"&gt;&amp;gt; The tests run on a single machine, between two &lt;BR&gt;&amp;gt; processes. I have only tested C++ so far. I might do some Python &lt;BR&gt;&amp;gt; comparisons later. &lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;How does the comparison look if the two processes do not run on the &lt;BR&gt;same machine, but each process on a different machine ? &lt;BR&gt;
&lt;P&gt;Siegfried Rohdewald. &lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;A id=anchor_bec000af52c33109 name=bec000af52c33109&gt;&lt;/A&gt;&lt;BR&gt;&lt;!-- &lt;a name="dbec000af52c33109"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropenedbec000af52c33109 cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Juergen Weber &lt;webe...@gmail.com&gt;" noWrap bgColor=#cc8600&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Juergen Weber&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年11月27日 上午2时31分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=obec000af52c33109 onclick="return op('bec000af52c33109');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=hbec000af52c33109&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;"Juergen Weber" &amp;lt;webe&lt;A href="http://groups.google.com/groups/unlock?msg=bec000af52c33109&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@gmail.com&amp;gt;&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=iSQ-gBEAAACUsgAtO3nNV7b_AADKdXlzkdEasx1kiYTQavV7mdW13Q&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;26 Nov 2005 10:31:33 -0800&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年11月27日(星期日) 上午2时31分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;Re: omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=bec000af52c33109&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=bec000af52c33109&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/bec000af52c33109?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/bec000af52c33109" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/bec000af52c33109?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2Fbec000af52c33109" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbodybec000af52c33109&gt;
&lt;P&gt;&lt;A name=msg_bec000af52c33109&gt;&lt;/A&gt;Thanks Duncan, &lt;BR&gt;
&lt;P&gt;that is very interesting. &lt;BR&gt;
&lt;P&gt;Maybe somebody would care to repeat the tests using webservices ;-) &lt;BR&gt;
&lt;P&gt;The other day I ran a test with a huge real world IDL (lots of nested &lt;BR&gt;structures and sequences), request message size 1K, reply 64K using the &lt;BR&gt;old JDK 1.3.1 implementation (server did nothing but fill the data &lt;BR&gt;structures from dummy data). The round-trip between different machines &lt;BR&gt;took about 70ms, which is about 10^4 slower than your ping numbers, but &lt;BR&gt;still very fast, imho. &lt;BR&gt;
&lt;P&gt;Juergen &lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;A id=anchor_0f3d7831a1ddc729 name=0f3d7831a1ddc729&gt;&lt;/A&gt;&lt;BR&gt;&lt;!-- &lt;a name="d0f3d7831a1ddc729"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropened0f3d7831a1ddc729 cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Rob Ratcliff &lt;rrr6...@futuretek.com&gt;" noWrap bgColor=#802f97&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Rob Ratcliff&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年11月28日 下午1时19分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=o0f3d7831a1ddc729 onclick="return op('0f3d7831a1ddc729');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=h0f3d7831a1ddc729&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;Rob Ratcliff &amp;lt;rrr6&lt;A href="http://groups.google.com/groups/unlock?msg=0f3d7831a1ddc729&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@futuretek.com&amp;gt;&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=Hp8QlhUAAAA3wvAxeyogqU2bMhb8fsxCt4gpnI31jTClftH60ESI_w&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;Mon, 28 Nov 2005 05:19:13 GMT&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年11月28日(星期一) 下午1时19分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;Re: omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=0f3d7831a1ddc729&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=0f3d7831a1ddc729&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/0f3d7831a1ddc729?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/0f3d7831a1ddc729" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/0f3d7831a1ddc729?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2F0f3d7831a1ddc729" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbody0f3d7831a1ddc729&gt;
&lt;P&gt;&lt;A name=msg_0f3d7831a1ddc729&gt;&lt;/A&gt;It also might be interesting to see a comparison between two big endian &lt;BR&gt;machines and a big endian and a little endian machine just to see how &lt;BR&gt;much byte swapping impacts the performance. (Of course CORBA uses &lt;BR&gt;"receiver makes right" and &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; always uses little endian, so I'd expect &lt;BR&gt;to see different trends from each approach.) &lt;BR&gt;
&lt;P&gt;&lt;A class=qt onclick="return tog_quote(21811); " href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?hide_quotes=no#msg_0f3d7831a1ddc729"&gt;
&lt;DIV class=hqt id=qheader_shown_21811 style="DISPLAY: none"&gt;- 隐藏被引用文字 -&lt;/DIV&gt;
&lt;DIV class=sqt id=qheader_hidden_21811 style="DISPLAY: block"&gt;- 显示引用的文字 -&lt;/DIV&gt;&lt;/A&gt;
&lt;P&gt;&lt;/P&gt;
&lt;DIV class=qt id=qhide_21811 style="DISPLAY: none"&gt;Siegfried Rohdewald wrote: &lt;BR&gt;&amp;gt;Duncan Grisby wrote: &lt;BR&gt;&amp;gt;... &lt;BR&gt;
&lt;P&gt;&amp;gt;&amp;gt;The tests run on a single machine, between two &lt;BR&gt;&amp;gt;&amp;gt;processes. I have only tested C++ so far. I might do some Python &lt;BR&gt;&amp;gt;&amp;gt;comparisons later. &lt;BR&gt;
&lt;P&gt;&amp;gt;How does the comparison look if the two processes do not run on the &lt;BR&gt;&amp;gt;same machine, but each process on a different machine ? &lt;BR&gt;
&lt;P&gt;&amp;gt;Siegfried Rohdewald. &lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;A id=anchor_e050f328c92a9ec5 name=e050f328c92a9ec5&gt;&lt;/A&gt;&lt;BR&gt;&lt;!-- &lt;a name="de050f328c92a9ec5"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropenede050f328c92a9ec5 cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Steve Wampler &lt;swamp...@noao.edu&gt;" noWrap bgColor=#2e7044&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Steve Wampler&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年12月2日 上午5时08分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=oe050f328c92a9ec5 onclick="return op('e050f328c92a9ec5');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=he050f328c92a9ec5&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;Steve Wampler &amp;lt;swamp&lt;A href="http://groups.google.com/groups/unlock?msg=e050f328c92a9ec5&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@noao.edu&amp;gt;&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=2nJnFxEAAAAyPUdBR1-xmGfeVp8MF3szdPDdXUjlbOn07G5UBWfiIg&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;Thu, 01 Dec 2005 14:08:50 -0700&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年12月2日(星期五) 上午5时08分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;Re: omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=e050f328c92a9ec5&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=e050f328c92a9ec5&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/e050f328c92a9ec5?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/e050f328c92a9ec5" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/e050f328c92a9ec5?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2Fe050f328c92a9ec5" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbodye050f328c92a9ec5&gt;
&lt;P&gt;&lt;A name=msg_e050f328c92a9ec5&gt;&lt;/A&gt;Very interesting results. &amp;nbsp;I have a few questions. &lt;BR&gt;
&lt;P&gt;
&lt;DIV class=qt id=qhide_21812 style="DISPLAY: block"&gt;On Tue, 22 Nov 2005 12:12:55 +0000, Duncan Grisby wrote: &lt;BR&gt;&amp;gt; Both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB are run with no special configuration, so they &lt;BR&gt;&amp;gt; use the default options for everything. For omniORB, I tried both the &lt;BR&gt;&amp;gt; default TCP transport and the Unix domain socket transport. &lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;This decision concerns me, as the default configurations may &lt;BR&gt;have vastly different philosophies. &amp;nbsp;As an example, the &lt;BR&gt;PostgreSQL database comes configured for operating on small, &lt;BR&gt;slow box - you *have* to reconfigure it to get *any* sort of &lt;BR&gt;decent performance on a typical machine really used for &lt;BR&gt;databases these days. &amp;nbsp;It would be much more useful to see &lt;BR&gt;these comparisons done with both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and oO *fully* tuned &lt;BR&gt;for performance. &lt;BR&gt;
&lt;P&gt;How does oO 4.0.l6 compare against other ORBs? &amp;nbsp;Specifically, &lt;BR&gt;TAO (which &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; uses in their comparisons) and oO 3.x? &amp;nbsp;If &lt;BR&gt;oO 4.0.6's performance against TAO is consistent with &lt;BR&gt;&lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice's&lt;/B&gt; performance against TAO, then the above oO vs &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; &lt;BR&gt;numbers have an increased 'validity potential'. &amp;nbsp;If they &lt;BR&gt;don't (for example, if TAO is faster...), then I'm still &lt;BR&gt;left wondering whose version of the performance tests were &lt;BR&gt;done 'right'. &lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;A id=anchor_515bd33b836c5e80 name=515bd33b836c5e80&gt;&lt;/A&gt;&lt;BR&gt;&lt;!-- &lt;a name="d515bd33b836c5e80"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropened515bd33b836c5e80 cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Marc Laukien &lt;m...@zeroc.com&gt;" noWrap bgColor=#d66103&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Marc Laukien&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年12月2日 上午5时31分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=o515bd33b836c5e80 onclick="return op('515bd33b836c5e80');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=h515bd33b836c5e80&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;Marc Laukien &amp;lt;m&lt;A href="http://groups.google.com/groups/unlock?msg=515bd33b836c5e80&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@zeroc.com&amp;gt;&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=8ODtGA4AAADudRWl68Z720Aht40AEAca&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;Thu, 01 Dec 2005 16:31:45 -0500&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年12月2日(星期五) 上午5时31分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;Re: omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=515bd33b836c5e80&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=515bd33b836c5e80&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/515bd33b836c5e80?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/515bd33b836c5e80" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/515bd33b836c5e80?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2F515bd33b836c5e80" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbody515bd33b836c5e80&gt;
&lt;P&gt;&lt;A name=msg_515bd33b836c5e80&gt;&lt;/A&gt;I can confirm that omniORB is faster than &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; for the tests that Duncan &lt;BR&gt;performed. omniORB is definitely a well-engineered product, with some &lt;BR&gt;very clever concurrency models. However, the concurrency models are also &lt;BR&gt;not directly comparable to what &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; offers. For example, &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; uses a &lt;BR&gt;leader/follower thread pool both for the server side and the client side &lt;BR&gt;(for AMI callbacks). Whether or not the concurrency model difference is &lt;BR&gt;relevant depends on your application. &lt;BR&gt;
&lt;P&gt;I'd also like to point out that we have never claimed that &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; is faster &lt;BR&gt;than omniORB. I know omniORB back from my CORBA days, and it has always &lt;BR&gt;been known to be one of the fastest CORBA implementations. &lt;BR&gt;
&lt;P&gt;-- Marc &lt;BR&gt;
&lt;P&gt;&lt;A class=qt onclick="return tog_quote(21813); " href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?hide_quotes=no#msg_515bd33b836c5e80"&gt;
&lt;DIV class=hqt id=qheader_shown_21813 style="DISPLAY: none"&gt;- 隐藏被引用文字 -&lt;/DIV&gt;
&lt;DIV class=sqt id=qheader_hidden_21813 style="DISPLAY: block"&gt;- 显示引用的文字 -&lt;/DIV&gt;&lt;/A&gt;
&lt;P&gt;&lt;/P&gt;
&lt;DIV class=qt id=qhide_21813 style="DISPLAY: none"&gt;Steve Wampler wrote: &lt;BR&gt;&amp;gt; Very interesting results. &amp;nbsp;I have a few questions. &lt;BR&gt;
&lt;P&gt;&amp;gt; On Tue, 22 Nov 2005 12:12:55 +0000, Duncan Grisby wrote: &lt;BR&gt;
&lt;P&gt;&amp;gt;&amp;gt;Both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB are run with no special configuration, so they &lt;BR&gt;&amp;gt;&amp;gt;use the default options for everything. For omniORB, I tried both the &lt;BR&gt;&amp;gt;&amp;gt;default TCP transport and the Unix domain socket transport. &lt;BR&gt;
&lt;P&gt;&amp;gt; This decision concerns me, as the default configurations may &lt;BR&gt;&amp;gt; have vastly different philosophies. &amp;nbsp;As an example, the &lt;BR&gt;&amp;gt; PostgreSQL database comes configured for operating on small, &lt;BR&gt;&amp;gt; slow box - you *have* to reconfigure it to get *any* sort of &lt;BR&gt;&amp;gt; decent performance on a typical machine really used for &lt;BR&gt;&amp;gt; databases these days. &amp;nbsp;It would be much more useful to see &lt;BR&gt;&amp;gt; these comparisons done with both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and oO *fully* tuned &lt;BR&gt;&amp;gt; for performance. &lt;BR&gt;
&lt;P&gt;&amp;gt; How does oO 4.0.l6 compare against other ORBs? &amp;nbsp;Specifically, &lt;BR&gt;&amp;gt; TAO (which &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; uses in their comparisons) and oO 3.x? &amp;nbsp;If &lt;BR&gt;&amp;gt; oO 4.0.6's performance against TAO is consistent with &lt;BR&gt;&amp;gt; &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice's&lt;/B&gt; performance against TAO, then the above oO vs &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; &lt;BR&gt;&amp;gt; numbers have an increased 'validity potential'. &amp;nbsp;If they &lt;BR&gt;&amp;gt; don't (for example, if TAO is faster...), then I'm still &lt;BR&gt;&amp;gt; left wondering whose version of the performance tests were &lt;BR&gt;&amp;gt; done 'right'. &lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;A id=anchor_b7cbfb9b32383d0d name=b7cbfb9b32383d0d&gt;&lt;/A&gt;&lt;BR&gt;&lt;!-- &lt;a name="db7cbfb9b32383d0d"&gt;&lt;/a&gt; --&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://groups.google.com/img/dot_clear.gif" width=2&gt;&lt;/TD&gt;
&lt;TD width="100%"&gt;
&lt;TABLE class=mo id=hdropenedb7cbfb9b32383d0d cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" width="1%"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=oa title="Douglas C. Schmidt &lt;schm...@ace.cs.wustl.edu&gt;" noWrap bgColor=#512dbd&gt;&lt;B&gt;&lt;FONT color=#ffffff&gt;Douglas C. Schmidt&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;
&lt;TD style="PADDING-LEFT: 10px"&gt;2005年12月2日 上午6时48分 &amp;nbsp; &lt;NOBR&gt;&lt;SPAN class=noscripthide&gt;&lt;A class=f id=ob7cbfb9b32383d0d onclick="return op('b7cbfb9b32383d0d');" href="http://groups.google.com/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e?q=ice&amp;amp;rnum=2#"&gt;&lt;FONT color=#551a8b&gt;显示选项&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/NOBR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV class=scripthide id=hb7cbfb9b32383d0d&gt;
&lt;TABLE cellSpacing=0 cellPadding=2 width="100%" bgColor=#e8e8e8 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;新闻论坛：&lt;B&gt;comp.object.corba&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;发件人： &lt;SPAN&gt;&lt;B&gt;schm&lt;A href="http://groups.google.com/groups/unlock?msg=b7cbfb9b32383d0d&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@ace.cs.wustl.edu (Douglas C. Schmidt)&lt;/B&gt;&lt;/SPAN&gt; - &lt;A href="http://groups.google.com/groups?enc_author=jYnizBgAAAClTt0PV26vuY-g-3RsvaJyQOm7a5F1_Sx8-DQzhQgSlA&amp;amp;scoring=d" target=_top&gt;&lt;FONT color=#0000cc&gt;查找此作者的帖子&lt;/FONT&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;日期：&lt;B&gt;1 Dec 2005 16:48:57 -0600&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;当地时间：&lt;B&gt;2005年12月2日(星期五) 上午6时48分&lt;/B&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;主题：&lt;B&gt;Re: omniORB and Ice performance compared&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=ar&gt;&lt;FONT size=-1&gt;&lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=b7cbfb9b32383d0d&amp;amp;reply_to=author&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;答复作者&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/post?inreplyto=b7cbfb9b32383d0d&amp;amp;forward=1&amp;amp;_done=%2Fgroup%2Fcomp.object.corba%2Fbrowse_thread%2Fthread%2F1106eb2c0ae4bc41%2Fcc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2%26&amp;amp;" target=_top&gt;&lt;FONT color=#0000cc&gt;转发&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/b7cbfb9b32383d0d?dmode=print" target=_blank&gt;&lt;FONT color=#0000cc&gt;打印&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/b7cbfb9b32383d0d" target=_parent&gt;&lt;FONT color=#0000cc&gt;显示个别帖子&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/group/comp.object.corba/msg/b7cbfb9b32383d0d?dmode=source" target=_blank&gt;&lt;FONT color=#0000cc&gt;显示原始邮件&lt;/FONT&gt;&lt;/A&gt; | &lt;A href="http://groups.google.com/groups/abuse?group=comp.object.corba&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fcomp.object.corba%2Fmsg%2Fb7cbfb9b32383d0d" target=_blank&gt;&lt;FONT color=#0000cc&gt;报告滥用行为&lt;/FONT&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV class=mbody id=mbodyb7cbfb9b32383d0d&gt;
&lt;P&gt;&lt;A name=msg_b7cbfb9b32383d0d&gt;&lt;/A&gt;Hi Folks, &lt;BR&gt;
&lt;P&gt;++ On Tue, 22 Nov 2005 12:12:55 +0000, Duncan Grisby wrote: &lt;BR&gt;++ &amp;gt; Both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and omniORB are run with no special configuration, so they &lt;BR&gt;++ &amp;gt; use the default options for everything. For omniORB, I tried both the &lt;BR&gt;++ &amp;gt; default TCP transport and the Unix domain socket transport. &lt;BR&gt;++ &lt;BR&gt;++ This decision concerns me, as the default configurations may &lt;BR&gt;++ have vastly different philosophies. &amp;nbsp;As an example, the &lt;BR&gt;++ PostgreSQL database comes configured for operating on small, &lt;BR&gt;++ slow box - you *have* to reconfigure it to get *any* sort of &lt;BR&gt;++ decent performance on a typical machine really used for &lt;BR&gt;++ databases these days. &amp;nbsp;It would be much more useful to see &lt;BR&gt;++ these comparisons done with both &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; and oO *fully* tuned &lt;BR&gt;++ for performance. &lt;BR&gt;++ &lt;BR&gt;++ How does oO 4.0.l6 compare against other ORBs? &amp;nbsp;Specifically, &lt;BR&gt;++ TAO (which &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; uses in their comparisons) and oO 3.x? &amp;nbsp;If &lt;BR&gt;++ oO 4.0.6's performance against TAO is consistent with &lt;BR&gt;++ &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice's&lt;/B&gt; performance against TAO, then the above oO vs &lt;B style="COLOR: black; BACKGROUND-COLOR: #ffff66"&gt;Ice&lt;/B&gt; &lt;BR&gt;++ numbers have an increased 'validity potential'. &amp;nbsp;If they &lt;BR&gt;++ don't (for example, if TAO is faster...), then I'm still &lt;BR&gt;++ left wondering whose version of the performance tests were &lt;BR&gt;++ done 'right'. &lt;BR&gt;
&lt;P&gt;omniORB is widely considered as one of the fastest ORBs around. &amp;nbsp;I &lt;BR&gt;recommend you check out &lt;BR&gt;
&lt;P&gt;&lt;A href="http://www.atl.external.lmco.com/projects/QoS/compare/dist_oo_compare_ipc.html" target=_blank&gt;&lt;FONT color=#0000cc&gt;http://www.atl.external.lmco.com/projects/QoS/compare/dist_oo_compare...&lt;/FONT&gt;&lt;/A&gt; &lt;BR&gt;&lt;A href="http://nenya.ms.mff.cuni.cz/~bench/" target=_blank&gt;&lt;FONT color=#0000cc&gt;http://nenya.ms.mff.cuni.cz/~bench/&lt;/FONT&gt;&lt;/A&gt; &lt;BR&gt;
&lt;P&gt;for lots more information, benchmarks, and performance comparisons of &lt;BR&gt;various middleware. &lt;BR&gt;
&lt;P&gt;Thanks, &lt;BR&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Doug &lt;BR&gt;
&lt;P&gt;-- &lt;BR&gt;Dr. Douglas C. Schmidt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Professor and Associate Chair &lt;BR&gt;Electrical Engineering and Computer Science &amp;nbsp;TEL: (615) 343-8197 &lt;BR&gt;Institute for Software Integrated Systems &amp;nbsp; &amp;nbsp;WEB: &lt;A href="http://www.dre.vanderbilt.edu/~schmidt" target=_blank&gt;&lt;FONT color=#0000cc&gt;www.dre.vanderbilt.edu/~schmidt&lt;/FONT&gt;&lt;/A&gt; &lt;BR&gt;Vanderbilt University, Nashville TN, 37203 &amp;nbsp; NET: d.schm&lt;A href="http://groups.google.com/groups/unlock?msg=b7cbfb9b32383d0d&amp;amp;_done=/group/comp.object.corba/browse_thread/thread/1106eb2c0ae4bc41/cc3468b0c5e1ef8e%3Fq%3Dice%26rnum%3D2" target=_parent&gt;&lt;FONT color=#0000cc&gt;...&lt;/FONT&gt;&lt;/A&gt;@vanderbilt.edu &lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/16775.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>AIX上的aio(转贴)</title><link>http://blog.vckbase.com/bastet/archive/2005/11/11/14755.html</link><pubDate>Fri, 11 Nov 2005 10:06:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/11/11/14755.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/14755.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/11/11/14755.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/14755.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/14755.html</trackback:ping><description>&lt;P&gt;&lt;A href="http://www.loveunix.net/discuz/viewthread.php?tid=51746&amp;amp;extra=page%3D1"&gt;http://www.loveunix.net/discuz/viewthread.php?tid=51746&amp;amp;extra=page%3D1&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;
&lt;TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top&gt;&lt;SPAN style="FONT-SIZE: 13px"&gt;&lt;B&gt;Asynchronous I/O Subsystem&lt;/B&gt;&lt;BR&gt;&lt;BR&gt;Synchronous I/O occurs while you wait. Applications processing cannot continue until the I/O operation is complete.&lt;BR&gt;&lt;BR&gt;In contrast, asynchronous I/O operations run in the background and do not block user applications. This improves performance, because I/O operations and applications processing can run simultaneously.&lt;BR&gt;&lt;BR&gt;Using asynchronous I/O will usually improve your I/O throughput, especially when you are storing data in raw logical volumes (as opposed to Journaled file systems). The actual performance, however, depends on how many server processes are running that will handle the I/O requests.&lt;BR&gt;&lt;BR&gt;Many applications, such as databases and file servers, take advantage of the ability to overlap processing and I/O. These asynchronous I/O operations use various kinds of devices and files. Additionally, multiple asynchronous I/O operations can run at the same time on one or more devices or files.&lt;BR&gt;&lt;BR&gt;Each asynchronous I/O request has a corresponding control block in the application's address space. When an asynchronous I/O request is made, a handle is established in the control block. This handle is used to retrieve the status and the return values of the request.&lt;BR&gt;&lt;BR&gt;Applications use the aio_read and aio_write subroutines to perform the I/O. Control returns to the application from the subroutine, as soon as the request has been queued. The application can then continue processing while the disk operation is being performed.&lt;BR&gt;&lt;BR&gt;A kernel process (kproc), called a server, is in charge of each request from the time it is taken off the queue until it completes. The number of servers limits the number of disk I/O operations that can be in progress in the system simultaneously.&lt;BR&gt;&lt;BR&gt;The default values are minservers=1 and maxservers=10. In systems that seldom run applications that use asynchronous I/O, this is usually adequate. For environments with many disk drives and key applications that use asynchronous I/O, the default is far too low. The result of a deficiency of servers is that disk I/O seems much slower than it should be. Not only do requests spend inordinate lengths of time in the queue, but the low ratio of servers to disk drives means that the seek-optimization algorithms have too few requests to work with for each drive.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Note:&lt;/B&gt;&lt;BR&gt;Asynchronous I/O will not work if the control block or buffer is created using mmap (mapping segments).&lt;BR&gt;&lt;BR&gt;In AIX 5.2 there are two Asynchronous I/O Subsystems. The original AIX AIO, now called LEGACY AIO, has the same function names as the posix compliant POSIX AIO. The major differences between the two involve different parameter passing. Both subsytems are defined in the /usr/include/sys/aio.h file. The _AIO_AIX_SOURCE macro is used to distinguish between the two versions.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Note:&lt;/B&gt;&lt;BR&gt;The _AIO_AIX_SOURCE macro used in the /usr/include/sys/aio.h file must be defined when using this file to compile an aio application with the LEGACY AIO function definitions. The default compile using the aio.h file is for an application with the new POSIX AIO definitions. To use the LEGACY AIO function defintions do the following in the source file: &lt;BR&gt;#define _AIO_AIX_SOURCE &lt;BR&gt;#include &amp;lt;sys/aio.h&amp;gt;&lt;BR&gt;or when compiling on the command line, type the following: &lt;BR&gt;xlc ... -D_AIO_AIX_SOURCE ... classic_aio_program.c&lt;BR&gt;&lt;BR&gt;For each aio function there is a legacy and a posix definition. LEGACY AIO has an additional aio_nwait function, which although not a part of posix definitions has been included in POSIX AIO to help those who want to port from LEGACY to POSIX definitions. POSIX AIO has an additional aio_fsync function, which is not included in LEGACY AIO. For a list of these functions, see Asynchronous I/O Subroutines.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;How Do I Know if I Need to Use AIO?&lt;/B&gt;&lt;BR&gt;&lt;BR&gt;Using the vmstat command with an interval and count value, you can determine if the CPU is idle waiting for disk I/O. The wa column details the percentage of time the CPU was idle with pending local disk I/O.&lt;BR&gt;&lt;BR&gt;If there is at least one outstanding I/O to a local disk when the wait process is running, the time is classified as waiting for I/O. Unless asynchronous I/O is being used by the process, an I/O request to disk causes the calling process to block (or sleep) until the request has been completed. Once a process's I/O request completes, it is placed on the run queue.&lt;BR&gt;&lt;BR&gt;A wa value consistently over 25 percent may indicate that the disk subsystem is not balanced properly, or it may be the result of a disk-intensive workload.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Note:&lt;/B&gt;&lt;BR&gt;AIO will not relieve an overly busy disk drive. Using the iostat command with an interval and count value, you can determine if any disks are overly busy. Monitor the %tm_act column for each disk drive on the system. On some systems, a %tm_act of 35.0 or higher for one disk can cause noticeably slower performance. The relief for this case could be to move data from more busy to less busy disks, but simply having AIO will not relieve an overly busy disk problem.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;SMP Systems&lt;/B&gt;&lt;BR&gt;For SMP systems, the us, sy, id and wa columns are only averages over all processors. But keep in mind that the I/O wait statistic per processor is not really a processor-specific statistic; it is a global statistic. An I/O wait is distinguished from idle time only by the state of a pending I/O. If there is any pending disk I/O, and the processor is not busy, then it is an I/O wait time. Disk I/O is not tracked by processors, so when there is any I/O wait, all processors get charged (assuming they are all equally idle).&lt;BR&gt;&lt;BR&gt;&lt;B&gt;How Many AIO Servers Am I Currently Using?&lt;/B&gt;&lt;BR&gt;To determine you how many Posix AIO Servers (aios) are currently running, type the following on the command line:&lt;BR&gt;pstat -a | grep posix_aioserver | wc -l &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Note:&lt;/B&gt;&lt;BR&gt;You must run this command as the root user.&lt;BR&gt;To determine you how many Legacy AIO Servers (aios) are currently running, type the following on the command line:&lt;BR&gt;pstat -a | egrep ' aioserver' | wc -l&amp;nbsp;&amp;nbsp;&lt;BR&gt;Note:&lt;BR&gt;You must run this command as the root user.&lt;BR&gt;If the disk drives that are being accessed asynchronously are using either the Journaled File System (JFS) or the Enhanced Journaled File System (JFS2), all I/O will be routed through the aios kprocs.&lt;BR&gt;If the disk drives that are being accessed asynchronously are using a form of raw logical volume management, then the disk I/O is not routed through the aios kprocs. In that case the number of servers running is not relevant.&lt;BR&gt;&lt;BR&gt;However, if you want to confirm that an application that uses raw logic volumes is taking advantage of AIO, you can disable the fast path option via SMIT. When this option is disabled, even raw I/O will be forced through the aios kprocs. At that point, the pstat command listed in preceding discussion will work. You would not want to run the system with this option disabled for any length of time. This is simply a suggestion to confirm that the application is working with AIO and raw logical volumes.&lt;BR&gt;At releases earlier than AIX 4.3, the fast path is enabled by default and cannot be disabled.&lt;BR&gt;How Many AIO Servers Do I Need?&lt;BR&gt;Here are some suggested rules of thumb for determining what value to set maximum number of servers to:&lt;BR&gt;1.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The first rule of thumb suggests that you limit the maximum number of servers to a number equal to ten times the number of disks that are to be used concurrently, but not more than 80. The minimum number of servers should be set to half of this maximum number. &lt;BR&gt;2.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Another rule of thumb is to set the maximum number of servers to 80 and leave the minimum number of servers set to the default of 1 and reboot. Monitor the number of additional servers started throughout the course of normal workload. After a 24-hour period of normal activity, set the maximum number of servers to the number of currently running aios + 10, and set the minimum number of servers to the number of currently running aios - 10. &lt;BR&gt;In some environments you may see more than 80 aios KPROCs running. If so, consider the third rule of thumb.&lt;BR&gt;3.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A third suggestion is to take statistics using vmstat -s before any high I/O activity begins, and again at the end. Check the field iodone. From this you can determine how many physical I/Os are being handled in a given wall clock period. Then increase the maximum number of servers and see if you can get more iodones in the same time period.&lt;BR&gt;Prerequisites&lt;BR&gt;To make use of asynchronous I/O the following fileset must be installed:&lt;BR&gt;bos.rte.aio&lt;BR&gt;To determine if this fileset is installed, use:&lt;BR&gt;lslpp -l bos.rte.aio&lt;BR&gt;You must also make the aio0 or posix_aio0 device available using SMIT.&lt;BR&gt;smit chgaio&lt;BR&gt;smit chgposixaio&lt;BR&gt;&lt;BR&gt;STATE to be configured at system restart available&lt;BR&gt;or&lt;BR&gt;smit aio&lt;BR&gt;smit posixaio&lt;BR&gt;&lt;BR&gt;Configure aio now&lt;BR&gt;Functions of Asynchronous I/O&lt;BR&gt;Functions provided by the asynchronous I/O facilities are:&lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Large File-Enabled Asynchronous I/O &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nonblocking I/O &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Notification of I/O completion &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cancellation of I/O requests&lt;BR&gt;Large File-Enabled Asynchronous I/O&lt;BR&gt;The fundamental data structure associated with all asynchronous I/O operations is struct aiocb. Within this structure is the aio_offset field which is used to specify the offset for an I/O operation.&lt;BR&gt;Due to the signed 32-bit definition of aio_offset, the default asynchronous I/O interfaces are limited to an offset of 2G minus 1. To overcome this limitation, a new aio control block with a signed 64-bit offset field and a new set of asynchronous I/O interfaces has been defined. These 64&amp;#8211;bit definitions end with "64".&lt;BR&gt;The large offset-enabled asynchronous I/O interfaces are available under the _LARGE_FILES compilation environment and under the _LARGE_FILE_API programming environment. For further information, see Writing Programs That Access Large Files in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging Programs.&lt;BR&gt;Under the _LARGE_FILES compilation environment, asynchronous I/O applications written to the default interfaces see the following redefinitions:&lt;BR&gt;Item&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Redefined To Be&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Header File&lt;BR&gt;struct aiocb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; struct aiocb64&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_read()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_read64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_write()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_write64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_cancel()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_cancel64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_suspend()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_suspend64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_listio()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_listio64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_return()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_return64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;aio_error()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aio_error64()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys/aio.h&lt;BR&gt;For information on using the _LARGE_FILES environment, see Porting Applications to the Large File Environment in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging Programs&lt;BR&gt;In the _LARGE_FILE_API environment, the 64-bit API interfaces are visible. This environment requires recoding of applications to the new 64-bit API name. For further information on using the _LARGE_FILE_API environment, see Using the 64-Bit File System Subroutines in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging Programs&lt;BR&gt;Nonblocking I/O&lt;BR&gt;After issuing an I/O request, the user application can proceed without being blocked while the I/O operation is in progress. The I/O operation occurs while the application is running. Specifically, when the application issues an I/O request, the request is queued. The application can then resume running before the I/O operation is initiated.&lt;BR&gt;To manage asynchronous I/O, each asynchronous I/O request has a corresponding control block in the application's address space. This control block contains the control and status information for the request. It can be used again when the I/O operation is completed.&lt;BR&gt;Notification of I/O Completion&lt;BR&gt;After issuing an asynchronous I/O request, the user application can determine when and how the I/O operation is completed. This information is provided in three ways:&lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The application can poll the status of the I/O operation. &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The system can asynchronously notify the application when the I/O operation is done. &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The application can block until the I/O operation is complete.&lt;BR&gt;Polling the Status of the I/O Operation&lt;BR&gt;The application can periodically poll the status of the I/O operation. The status of each I/O operation is provided in the application's address space in the control block associated with each request. Portable applications can retrieve the status by using the aio_error subroutine.The aio_suspend subroutine suspends the calling process until one or more asynchronous I/O requests are completed.&lt;BR&gt;Asynchronously Notifying the Application When the I/O Operation Completes&lt;BR&gt;Asynchronously notifying the I/O completion is done by signals. Specifically, an application may request that a SIGIO signal be delivered when the I/O operation is complete. To do this, the application sets a flag in the control block at the time it issues the I/O request. If several requests have been issued, the application can poll the status of the requests to determine which have actually completed.&lt;BR&gt;Blocking the Application until the I/O Operation Is Complete&lt;BR&gt;The third way to determine whether an I/O operation is complete is to let the calling process become blocked and wait until at least one of the I/O requests it is waiting for is complete. This is similar to synchronous style I/O. It is useful for applications that, after performing some processing, need to wait for I/O completion before proceeding.&lt;BR&gt;Cancellation of I/O Requests&lt;BR&gt;I/O requests can be canceled if they are cancelable. Cancellation is not guaranteed and may succeed or not depending upon the state of the individual request. If a request is in the queue and the I/O operations have not yet started, the request is cancellable. Typically, a request is no longer cancelable when the actual I/O operation has begun.&lt;BR&gt;Asynchronous I/O Subroutines&lt;BR&gt;&lt;B&gt;Note:&lt;/B&gt;The 64-bit APIs are as follows:&lt;BR&gt;The following subroutines are provided for performing asynchronous I/O:&lt;BR&gt;Subroutine&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Purpose&lt;BR&gt;aio_cancel or aio_cancel64&lt;BR&gt;Cancels one or more outstanding asynchronous I/O requests.&lt;BR&gt;aio_error or aio_error64&lt;BR&gt;Retrieves the error status of an asynchronous I/O request.&lt;BR&gt;aio_fsync&lt;BR&gt;Synchronizes asynchronous files.&lt;BR&gt;lio_listio or lio_listio64&lt;BR&gt;Initiates a list of asynchronous I/O requests with a single call.&lt;BR&gt;aio_nwait&lt;BR&gt;Suspends the calling process until n asynchronous I/O requests are completed.&lt;BR&gt;aio_read or aio_read64&lt;BR&gt;Reads asynchronously from a file.&lt;BR&gt;aio_return or aio_return64&lt;BR&gt;Retrieves the return status of an asynchronous I/O request.&lt;BR&gt;aio_suspend or aio_suspend64&lt;BR&gt;Suspends the calling process until one or more asynchronous I/O requests is completed.&lt;BR&gt;aio_write or aio_write64&lt;BR&gt;Writes asynchronously to a file.&lt;BR&gt;Order and Priority of Asynchronous I/O Calls&lt;BR&gt;&lt;BR&gt;An application may issue several asynchronous I/O requests on the same file or device. However, because the I/O operations are performed asynchronously, the order in which they are handled may not be the order in which the I/O calls were made. The application must enforce ordering of its own I/O requests if ordering is required.&lt;BR&gt;&lt;BR&gt;Priority among the I/O requests is not currently implemented. The aio_reqprio field in the control block is currently ignored.&lt;BR&gt;&lt;BR&gt;For files that support seek operations, seeking is allowed as part of the asynchronous read or write operations. The whence and offset fields are provided in the control block of the request to set the seek parameters. The seek pointer is updated when the asynchronous read or write call returns.&lt;BR&gt;Subroutines Affected by Asynchronous I/O&lt;BR&gt;&lt;BR&gt;The following existing subroutines are affected by asynchronous I/O:&lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The close subroutine &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The exit subroutine &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The exec subroutine &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The fork subroutine&lt;BR&gt;&lt;BR&gt;If the application closes a file, or calls the _exit or exec subroutines while it has some outstanding I/O requests, the requests are canceled. If they cannot be canceled, the application is blocked until the requests have completed. When a process calls the fork subroutine, its asynchronous I/O is not inherited by the child process.&lt;BR&gt;&lt;BR&gt;One fundamental limitation in asynchronous I/O is page hiding. When an unbuffered (raw) asynchronous I/O is issued, the page that contains the user buffer is hidden during the actual I/O operation. This ensures cache consistency. However, the application may access the memory locations that fall within the same page as the user buffer. This may cause the application to block as a result of a page fault. To alleviate this, allocate page aligned buffers and do not touch the buffers until the I/O request using it has completed.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Changing Attributes for Asynchronous I/O&lt;/B&gt;&lt;BR&gt;You can change attributes relating to asynchronous I/O using the chdev command or SMIT. Likewise, you can use SMIT to configure and remove (unconfigure) asynchronous I/O. (Alternatively, you can use the mkdev and rmdev commands to configure and remove asynchronous I/O). To start SMIT at the main menu for asynchronous I/O, enter smit aio or smit posixaio.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;MINIMUM number of servers &lt;/B&gt;&lt;BR&gt;Indicates the minimum number of kernel processes dedicated to asynchronous I/O processing. Because each kernel process uses memory, this number should not be large when the amount of asynchronous I/O expected is small. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;MAXIMUM number of servers per cpu &lt;/B&gt;&lt;BR&gt;Indicates the maximum number of kernel processes per cpu that are dedicated to asynchronous I/O processing. This number when multiplied by the number of cpus indicates the limit on I/O requests in progress at one time, and represents the limit for possible I/O concurrency. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Maximum number of REQUESTS &lt;/B&gt;&lt;BR&gt;Indicates the maximum number of asynchronous I/O requests that can be outstanding at one time. This includes requests that are in progress as well as those that are waiting to be started. The maximum number of asynchronous I/O requests cannot be less than the value of AIO_MAX, as defined in the /usr/include/sys/limits.h file, but it can be greater. It would be appropriate for a system with a high volume of asynchronous I/O to have a maximum number of asynchronous I/O requests larger than AIO_MAX. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Server PRIORITY &lt;/B&gt;&lt;BR&gt;Indicates the priority level of kernel processes dedicated to asynchronous I/O. The lower the priority number is, the more favored the process is in scheduling. Concurrency is enhanced by making this number slightly less than the value of PUSER, the priority of a normal user process. It cannot be made lower than the values of PRI_SCHED. &lt;BR&gt;Because the default priority is (40+nice), these daemons will be slightly favored with this value of (39+nice). If you want to favor them more, make changes slowly. A very low priority can interfere with the system process that require low priority.&lt;BR&gt;Attention: Raising the server PRIORITY (decreasing this numeric value) is not recommended because system hangs or crashes could occur if the priority of the AIO servers is favored too much. There is little to be gained by making big priority changes.&lt;BR&gt;PUSER and PRI_SCHED are defined in the /usr/include/sys/pri.h file.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;STATE to be configured at system restart &lt;/B&gt;&lt;BR&gt;Indicates the state to which asynchronous I/O is to be configured during system initialization. The possible values are: &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; defined, which indicates that the asynchronous I/O will be left in the defined state and not available for use &lt;BR&gt;&amp;#8226;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; available, which indicates that asynchronous I/O will be configured and available for use&lt;BR&gt;&lt;BR&gt;&lt;B&gt;STATE of FastPath &lt;/B&gt;&lt;BR&gt;The AIO Fastpath is used only on character devices (raw logical volumes) and sends I/O requests directly to the underlying device. The file system path used on block devices uses the aio kprocs to send requests through file system routines provided to kernel extensions. Disabling this option forces all I/O activity through the aios kprocs, including I/O activity that involves raw logical volumes. In AIX 4.3 and earlier, the fast path is enabled by default and cannot be disabled. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;64-bit Enhancements&lt;/B&gt;&lt;BR&gt;Asynchronous I/O (AIO) has been enhanced to support 64-bit enabled applications. On 64-bit platforms, both 32-bit and 64-bit AIO can occur simultaneously.&lt;BR&gt;The struct aiocb, the fundamental data structure associated with all asynchronous I/O operation, has changed. The element of this struct, aio_return, is now defined as ssize_t. Previously, it was defined as an int. AIO supports large files by default. An application compiled in 64-bit mode can do AIO to a large file without any additional #define or special opening of those files.&lt;/SPAN&gt; &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="HEIGHT: 20em" vAlign=bottom&gt;&lt;IMG src="http://www.loveunix.net/discuz/images/common/sigline.gif"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 13px"&gt;看来很久之前的以讹传讹是在是影响太厉害了。&lt;BR&gt;1、aio server不是进程，是kernel threading，所以效率才高，要不不如用用户态的thread或者processor实现AIO算了。&lt;BR&gt;2&amp;nbsp;&amp;nbsp;and 3 显然find使用的syscall是read而不是aio_read，所以只能用阻塞IO，就算你配置了AIO ENABLE也不可能出现你说的3的情况。&lt;BR&gt;4、最大的以讹传讹，AIO可以用于RAW DEVICE，而且效果更好。因为大多数的UNIX的AIO实现是这样的，如果对RAW DEVICE用aio_read aio_write是，是用kernel threading，效率最高；但是对于FS，只能用lwp 或者thread模拟，效率低很多。所以在使用INFORMIX DB2等等DBMS的时候，要充分发挥aio的效果，应该用raw device做数据容器。&lt;BR&gt;5、再次强调，aio server是kernel threading，和用户自己创建的thread或者process都不同。当然AIO SERVER没有必要配置的太多，要根据 应用和使用的磁盘控制器数量等决定。&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 13px"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/14755.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>网络编程常用设计模式</title><link>http://blog.vckbase.com/bastet/archive/2005/10/29/14293.html</link><pubDate>Sat, 29 Oct 2005 15:46:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/10/29/14293.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/14293.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/10/29/14293.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/14293.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/14293.html</trackback:ping><description>&lt;P class=para&gt;&lt;B class=bold&gt;Abstract Factory&lt;/B&gt; [GoF95] provides an interface for creating families of related or dependent objects without specifying their concrete classes.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Abstract Manager&lt;/B&gt; [Lieb01] focuses on the management of business objects in enterprise systems.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Activator&lt;/B&gt; [Stal00] helps to implement efficient on-demand activation and deactivation of services that are accessed by multiple clients.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Active Object&lt;/B&gt; [POSA2] decouples method execution from method invocation.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Adapter&lt;/B&gt; [GoF95] converts the interface of a class into an interface expected by clients. Adapter allows classes to work together that could not do so otherwise because of incompatible interfaces.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Asynchronous Completion Token&lt;/B&gt; [POSA2] allows an application efficiently to demultiplex and process the responses of asynchronous operations it invokes on services.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Cache Management&lt;/B&gt; [Gran98] focuses on caching objects in Java and on how to combine a cache with the Manager [Somm98] pattern.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Cache Proxy&lt;/B&gt; [POSA1] implements caching inside a proxy that represents the data source from which one or multiple clients want to retrieve data.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Comparand&lt;/B&gt; [CoHa01] provides a means of interpreting differing objects as being the same in specific contexts. It does this by introducing an instance variable, the comparand, in each class of interest, and using it for comparison. Establishing the &amp;#8216;sameness&amp;#8217; of differing objects is necessary when more than one reference refers conceptually to the same object.&lt;/P&gt;
&lt;P class=para&gt;&lt;A name=463&gt;&lt;/A&gt;&lt;A name=page244&gt;&lt;/A&gt;&lt;B class=bold&gt;Component Configurator&lt;/B&gt; [POSA2] allows an application to link and unlink its component implementations at run-time without having to modify, recompile, or statically relink the application.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Command Processor&lt;/B&gt; [POSA1] separates the request for a service from its execution. A command processor component manages requests as separate objects, schedules their execution, and provides additional services such as storing request objects for later undo.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Data Transfer Object&lt;/B&gt; [Fowl02] carries data, for example other objects or invocation parameters, between remote clients and servers. The encapsulation provided by this pattern reduces the number of remote operations required to transfer such data.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Deployer&lt;/B&gt; [Stal00] describes how to configure, deploy, and install software artifacts.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Disposal Method&lt;/B&gt; [Henn03] encapsulates the concrete details of object disposal by providing an explicit method for cleaning up objects, instead of abandoning the objects to be garbage collected or terminating them by deletion.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Double-Checked Locking Optimization&lt;/B&gt; [POSA2] reduces contention and synchronization overheads when critical sections of code must acquire locks in a thread-safe manner just once during program execution.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Factory Method&lt;/B&gt; [GoF95] defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Fixed Allocation&lt;/B&gt; [NoWe00] allows memory consumption to be predicted by allocating the necessary memory at program initialization.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Flyweight&lt;/B&gt; [GoF95] uses sharing to support large numbers of fine-grained objects efficiently.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Half-Object Plus Protocol&lt;/B&gt; [Mesz95] divides the responsibilities of an object into halves and assigns them to two interdependent half-objects when an object is used by two distributed clients. For efficiency reasons, each half-object implements the responsibility that is most used locally. This pattern lets the half-objects coordinate themselves via some protocol.&lt;/P&gt;
&lt;P class=para&gt;&lt;A name=464&gt;&lt;/A&gt;&lt;A name=page245&gt;&lt;/A&gt;&lt;B class=bold&gt;Interceptor&lt;/B&gt; [POSA2] allows services to be added to a framework transparently and triggered automatically when specific events occur.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Lazy Load&lt;/B&gt; [Fowl02] defers the loading of data from databases until it is first accessed.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Lazy Optimization&lt;/B&gt; [Auer96] optimizes the performance of a piece of software only after the design has been correctly determined.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Lazy Propagator&lt;/B&gt; [FeTi97] describes how, in a network of dependent objects, objects can determine when they are affected by the state changes of other objects, and therefore need to update their state.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Lazy State&lt;/B&gt; [MoOh97] defers the initialization of the state of an object [GoF95] until the state is accessed.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Manager&lt;/B&gt; [Somm98] places functionality that applies to all objects of a class into a separate management object. This separation allows the independent variation of management functionality and its reuse for different object classes.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Master-Slave&lt;/B&gt; [POSA1] supports fault tolerance, parallel computation and computational accuracy. A master component distributes work to identical slave components and computes a final result from the results returned by the slaves.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Mediator&lt;/B&gt; [GoF95] defines an object that encapsulates the way in which a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and allows their interaction to be varied independently.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Memento&lt;/B&gt; [GoF95] encapsulates the state of an object in a separate, persistable object.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Model-View-Controller&lt;/B&gt; [POSA1] divides an interactive application into three components. The model contains the core functionality and data, the view displays information to the user, and the controller handles user input. The view and controller together comprise the user interface. A change-propagation mechanism ensures consistency between the user interface and the model.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Object Lifetime Manager&lt;/B&gt; [LGS01] is specialized for the management of singleton objects in operating systems that do not support static destructors properly, such as real-time operating systems.&lt;/P&gt;
&lt;P class=para&gt;&lt;A name=465&gt;&lt;/A&gt;&lt;A name=page246&gt;&lt;/A&gt;&lt;B class=bold&gt;Object Pool&lt;/B&gt; [Gran98] manages the reuse of objects of a type that is expensive to create, or of which only a limited number can be created.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Page Cache&lt;/B&gt; [TMQH+03] improves response times when dynamically-generated Web pages are accessed. A page cache is associated with a Web server that uses it to store accessed pages indexed by their URLs. When the same URL is requested, the Web server queries the cache and returns the cached page instead of dynamically generating its contents again.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Passivation&lt;/B&gt; [VSW02] persists and activates memory representations of component instances to and from persistent storage.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Pooled Allocation&lt;/B&gt; [NoWe00] pre-allocates a pool of memory blocks, recycling them when returned.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Proxy&lt;/B&gt; [GoF95] provides a surrogate or placeholder for another object, to control access to it.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Proactive Resource Allocation&lt;/B&gt; [Cros02] anticipates system changes and plans necessary resource allocations ahead of time, with the goal of maintaining system performance even under changed conditions.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Reactor&lt;/B&gt; [POSA2] allows event-driven applications to demultiplex and dispatch service requests that are delivered to an application from one or more clients.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Reflection&lt;/B&gt; [POSA1] provides a mechanism for changing the structure and behavior of software systems dynamically. A meta level provides information about selected system properties and makes the software self-aware.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Resource Exchanger&lt;/B&gt; [SaCa96] reduces a server's load when allocating and using resources by sharing common buffers that are passed between clients and servers.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Singleton&lt;/B&gt; [GoF95] ensures a class has only one instance, and provides a global point of access to it.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Sponsor-Selector&lt;/B&gt; [Wall97] separates three fundamentally different responsibilities: recommending a resource, selecting among resources, and using a resource.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;State&lt;/B&gt; [GoF95] allows an object to alter its behavior when its internal state changes.&lt;/P&gt;
&lt;P class=para&gt;&lt;A name=466&gt;&lt;/A&gt;&lt;A name=page247&gt;&lt;/A&gt;&lt;B class=bold&gt;Strategy&lt;/B&gt; [GoF95] encapsulates logic, such as algorithms, into interchangeable classes that are independent of client requests.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Thread-local Memory Pool&lt;/B&gt; [Somm02] allows a memory allocator to be created for each thread. This helps to reduce synchronization overheads, since dynamic memory allocations are performed from a thread-local pool of pre-allocated memory.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Thread Pooling&lt;/B&gt; [PeSo97] describes how to bound the number of threads used and how to reuse unused threads.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Variable Allocation&lt;/B&gt; [NoWe00] optimizes memory consumption by performing memory allocations on demand.&lt;/P&gt;
&lt;P class=para&gt;&lt;B class=bold&gt;Virtual Proxy&lt;/B&gt; [GoF95] loads or constructs the object that the proxy represents on demand.&lt;/P&gt;
&lt;P class=last-para&gt;&lt;B class=bold&gt;Wrapper Facade&lt;/B&gt; [POSA2] encapsulates the functions and data provided by existing non-object-oriented APIs within more concise, robust, portable, maintainable, and cohesive object-oriented class interfaces.&lt;/P&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/14293.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>IPC-共享内存</title><link>http://blog.vckbase.com/bastet/archive/2005/10/06/12938.html</link><pubDate>Thu, 06 Oct 2005 12:04:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/10/06/12938.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/12938.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/10/06/12938.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/12938.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/12938.html</trackback:ping><description>&lt;P&gt;一共有三种，常用的是两种：ACE里封装了SRV的和POSIX的，名字叫ACE_Shared_Memory_MM(POSIX)和ACE_Shared_Memory_SV，他们都是从ACE_Shared_Memory继承而来，所以使用的时候一般这样用：&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;ACE_Shared_Memory *shm_client = new ACE_Shared_Memory_MM (shm_key);&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;ACE_Shared_Memory *shm_client=new ACE_Shared_Memory_SV (SHM_KEY, SHMSZ);&lt;BR&gt;&lt;/P&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H2 class=title&gt;&lt;A name=id5465820&gt;&lt;/A&gt;Chapter 3. &lt;A name=id28345&gt;&lt;/A&gt;Sharing Memory Between Processes&lt;/H2&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;There are three families of functions that let you create a segment of memory and share it among the address spaces of multiple processes. All produce the same result: a segment of memory that can be accessed or updated asynchronously by more than one process. You have to design protocols that prevent one process from changing shared data while another process is using the same data (see &lt;A name=idTIP_2b.ipcsmem1&gt;&lt;/A&gt;&lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch04.html#id82386"&gt;Chapter&amp;nbsp;4, &amp;#8220;Mutual Exclusion&amp;#8221;&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;This chapter covers three major topics:&lt;/P&gt;
&lt;DIV class=itemizedlist&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;
&lt;P&gt;&lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch03.html#id29423"&gt;&amp;#8220;POSIX Shared Memory Operations&amp;#8221;&lt;/A&gt; describes the POSIX functions for sharing memory.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch03.html#id62381"&gt;&amp;#8220;IRIX Shared Memory Arenas&amp;#8221;&lt;/A&gt; describes IRIX shared memory arenas.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch03.html#id17480"&gt;&amp;#8220;System V Shared Memory Functions&amp;#8221;&lt;/A&gt; describes the SVR4 functions.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H2 class=title&gt;&lt;A name=id5465927&gt;&lt;/A&gt;Overview of Memory Sharing&lt;/H2&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The address space is the range of memory locations that a process can use without an error. (The concept of the address space is covered in detail in &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch01.html#id82162"&gt;Chapter&amp;nbsp;1, &amp;#8220;Process Address Space.&amp;#8221;&lt;/A&gt;) In a pthreads program, all threads use the same address space and share its contents. In a program that starts multiple, lightweight processes with &lt;TT&gt;sproc()&lt;/TT&gt;, all processes share the same address space and its contents. In these programs, the entire address space is shared automatically.&lt;/P&gt;
&lt;P&gt;Normally, distinct processes (created by the &lt;TT&gt;fork()&lt;/TT&gt; or &lt;TT&gt;exec()&lt;/TT&gt; system calls) have distinct address spaces, with no writable contents in common. The facilities described in this chapter allow you to define a segment of memory that can be part of the address space of more than one process. Then processes or threads running in different address spaces can share data simply by referring to the contents of the shared segment in memory.&lt;/P&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5465983&gt;&lt;/A&gt;Shared Memory Based on mmap()&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The basic IRIX system operation for shared memory is the &lt;TT&gt;mmap()&lt;/TT&gt; function, with which a process makes the contents of a file part of its address space. The fundamental uses of &lt;TT&gt;mmap()&lt;/TT&gt; are covered under &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch01.html#id54272"&gt;&amp;#8220;Mapping Segments of Memory&amp;#8221;&lt;/A&gt; (see also the &lt;TT&gt;mmap(2)&lt;/TT&gt; reference page). When two or more processes map the same file into memory with the MAP_SHARED option, that single segment is part of both address spaces, and the processes can update its contents concurrently.&lt;/P&gt;
&lt;P&gt;The POSIX shared memory facility is a simple, formal interface to the use of &lt;TT&gt;mmap()&lt;/TT&gt; to share segments. The IRIX support for shared arenas is an extension of &lt;TT&gt;mmap()&lt;/TT&gt; to make it simpler to create a shared allocation arena and coordinate its use. The SVR4 facilities do not directly use &lt;TT&gt;mmap()&lt;/TT&gt; but have similar results.&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5466056&gt;&lt;/A&gt;&lt;A name=id53113&gt;&lt;/A&gt;Sharing Memory Between 32-Bit and 64-Bit Processes&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Larger Silicon Graphics systems support both 32-bit and 64-bit programs at the same time. It is possible for a memory segment to be mapped by programs using 32-bit addresses, and simultaneously mapped by programs that use 64-bit addresses. There is nothing to prevent such sharing.&lt;A name=idTIP_2b.ipcsmem2&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, such sharing can work satisfactorily only when the contents of the shared segment include no addresses at all. Pointer values stored by a 64-bit program can't be used by a 32-bit program and vice versa. Also the two programs will disagree about the size and offset of structure fields when structures contain addresses. For example, if you initialize an allocation arena with &lt;TT&gt;acreate()&lt;/TT&gt; from a 64-bit program, a 32-bit program calling &lt;TT&gt;amalloc()&lt;/TT&gt; on that same arena will almost certainly crash or corrupt the arena pointers.&lt;/P&gt;
&lt;P&gt;You can use POSIX shared memory, SVR4 shared memory, or basic &lt;TT&gt;mmap()&lt;/TT&gt; to share a segment between a 32-bit and a 64-bit program, provided you take pains to ensure that both programs view the data contents as having the same binary structure, and that no addresses are shared. You cannot use an IRIX shared memory arena between 32-bit and 64-bit programs at all, because the &lt;TT&gt;usinit()&lt;/TT&gt; function stores addresses in the arena.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H2 class=title&gt;&lt;A name=id5466182&gt;&lt;/A&gt;&lt;A name=id29423&gt;&lt;/A&gt;POSIX Shared Memory Operations&lt;/H2&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Shared-memory support specified by POSIX is based on the functions summarized in &lt;A name=idTIP_2b.ipcsmem3&gt;&lt;/A&gt;&lt;A name=idTIP_2b.ipcsmem4&gt;&lt;/A&gt;&lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch03.html#id81035"&gt;Table&amp;nbsp;3-1&lt;/A&gt;. &lt;/P&gt;
&lt;DIV class=table&gt;
&lt;P&gt;&lt;A name=id5466213&gt;&lt;/A&gt;&lt;B&gt;Table 3-1. &lt;A name=id81035&gt;&lt;/A&gt;POSIX Shared Memory Functions&lt;/B&gt;&lt;/P&gt;
&lt;TABLE summary=" POSIX Shared Memory Functions" border=1&gt;
&lt;COLGROUP&gt;
&lt;COL&gt;
&lt;COL&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR vAlign=top&gt;
&lt;TH vAlign=top scope=col&gt;
&lt;P&gt;Function Name&lt;/P&gt;&lt;/TH&gt;
&lt;TH vAlign=top scope=col&gt;
&lt;P&gt;Purpose and Operation&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;mmap(2) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Map a file or shared memory object into the address space.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;shm_open(2) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Create, or gain access to, a shared memory object.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;shm_unlink(2) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Destroy a shared memory object when no references to it remain open.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P&gt;The use of &lt;TT&gt;mmap()&lt;/TT&gt; is described at length under &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch01.html#id54272"&gt;&amp;#8220;Mapping Segments of Memory&amp;#8221;&lt;/A&gt;. In essence, &lt;TT&gt;mmap()&lt;/TT&gt; takes a file descriptor and makes the contents of the described object accessible as a segment of memory in the address space. In IRIX, a file descriptor can describe a disk file, or a device, or a special pseudo-device such as &lt;TT&gt;/dev/kmem&lt;/TT&gt;. Thus &lt;TT&gt;mmap()&lt;/TT&gt; can make a variety of objects part of the address space. POSIX adds one more type of mappable object, a persistent shared segment you create using the &lt;TT&gt;shm_open()&lt;/TT&gt; function.&lt;/P&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5466376&gt;&lt;/A&gt;Creating a Shared Object&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The &lt;TT&gt;shm_open()&lt;/TT&gt; function is very similar to the &lt;TT&gt;open()&lt;/TT&gt; function and takes the same arguments (compare the &lt;TT&gt;shm_open(2)&lt;/TT&gt; and &lt;TT&gt;open(2)&lt;/TT&gt; reference pages). The arguments are as follows: &lt;/P&gt;
&lt;DIV class=informaltable&gt;
&lt;TABLE border=1&gt;
&lt;COLGROUP&gt;
&lt;COL&gt;
&lt;COL&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;&lt;I&gt;path&lt;/I&gt; &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Name of object, a character string in the form of a file pathname.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;&lt;I&gt;oflag&lt;/I&gt; &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Option flags, detailed in the reference page and discussed in following text.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;&lt;I&gt;mode&lt;/I&gt; &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Access mode for the opened object&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P&gt;In order to declare &lt;TT&gt;shm_open()&lt;/TT&gt; and its arguments you need to include both &lt;TT&gt;sys/mman.h&lt;/TT&gt; and &lt;TT&gt;fcntl.h&lt;/TT&gt; header files.&lt;/P&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H4 class=title&gt;&lt;A name=id5466525&gt;&lt;/A&gt;Shared Object Pathname&lt;/H4&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The POSIX standard says that a shared object name has the form of a file pathname, but the standard leaves it &amp;#8220;implementation defined&amp;#8221; whether the object is actually a file or not. In the IRIX implementation, a shared memory object is also a file. The pathname you specify for a shared memory object is interpreted exactly like the pathname of a disk file that you pass to &lt;TT&gt;open()&lt;/TT&gt;. When you create a new object, you also create a disk file of the same name. (See &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch02.html#id66952"&gt;&amp;#8220;POSIX IPC Name Space&amp;#8221;&lt;/A&gt;.)&lt;/P&gt;
&lt;P&gt;You can display the size, ownership, and permissions of an existing shared segment using &lt;TT&gt;ls -l&lt;/TT&gt;. You can dump its contents with a command such as &lt;TT&gt;od -X&lt;/TT&gt;. You can remove it with &lt;TT&gt;rm&lt;/TT&gt;.&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H4 class=title&gt;&lt;A name=id5466615&gt;&lt;/A&gt;Shared Object Open Flags&lt;/H4&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The flags you pass to &lt;TT&gt;shm_open()&lt;/TT&gt; control its actions, as follows: &lt;/P&gt;
&lt;DIV class=informaltable&gt;
&lt;TABLE border=1&gt;
&lt;COLGROUP&gt;
&lt;COL&gt;
&lt;COL&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;O_RDONLY&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Access can be used only for reading.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;O_RDWR&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Access can be read-write (however, you can enforce read-only access when calling &lt;TT&gt;mmap()&lt;/TT&gt;). &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;O_CREAT&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;If the object does not exist, create it.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;O_TRUNC&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;If the object does exist and O_RDWR is specified, truncate it to zero length.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;O_EXCL&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;If the object does exist and O_CREAT is specified, return the EEXIST error code.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P&gt;The flags have the same meaning when opening a disk file with &lt;TT&gt;open()&lt;/TT&gt;. However, a number of other flags allowed by &lt;TT&gt;open()&lt;/TT&gt; are not relevant to shared memory objects.&lt;/P&gt;
&lt;P&gt;You can use the combination O_CREAT+O_EXCL to ensure that only one process initializes a shared object.&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H4 class=title&gt;&lt;A name=id5466815&gt;&lt;/A&gt;Shared Object Access Mode&lt;/H4&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The access mode that you specify when creating an object governs the users and groups that can open the object later, exactly as with a disk file.&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H4 class=title&gt;&lt;A name=id5466827&gt;&lt;/A&gt;Using the Shared Object File Descriptor&lt;/H4&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The value returned by &lt;TT&gt;shm_open()&lt;/TT&gt; is a file descriptor and you can use it as such; for example you can apply the &lt;TT&gt;dup()&lt;/TT&gt; function to make a copy of it. You can also use it as an argument to &lt;TT&gt;fcntl()&lt;/TT&gt;, but most of the features of &lt;TT&gt;fcntl()&lt;/TT&gt; are irrelevant to a shared memory object. (See the &lt;TT&gt;dup(2)&lt;/TT&gt; and &lt;TT&gt;fcntl(2)&lt;/TT&gt; reference pages.)&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5466877&gt;&lt;/A&gt;Using a Shared Object&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;In order to use a shared object, your program first opens it with &lt;TT&gt;shm_open()&lt;/TT&gt;, then maps it into memory with &lt;TT&gt;mmap()&lt;/TT&gt;. The arguments to &lt;TT&gt;mmap()&lt;/TT&gt; include&lt;/P&gt;
&lt;DIV class=itemizedlist&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;
&lt;P&gt;the file descriptor for the shared object&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;the size of the memory segment&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;access protection flags&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;
&lt;P&gt;The returned value is the base address of the segment in memory. You can then use it like any block of memory. For example, you could create an allocation arena in the segment using the &lt;TT&gt;acreate()&lt;/TT&gt; function (see the &lt;TT&gt;amalloc(3)&lt;/TT&gt; reference page). For more on the use of &lt;TT&gt;mmap()&lt;/TT&gt;, read &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch01.html#id29280"&gt;&amp;#8220;Segment Mapping Function mmap()&amp;#8221;&lt;/A&gt; and &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch01.html#id51714"&gt;&amp;#8220;Mapping a File for Shared Memory&amp;#8221;&lt;/A&gt;.&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5466994&gt;&lt;/A&gt;Example Program&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The program in &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch03.html#id23511"&gt;Example&amp;nbsp;3-1&lt;/A&gt; allows you to experiment with &lt;TT&gt;shm_open()&lt;/TT&gt; and &lt;TT&gt;mmap()&lt;/TT&gt; from the command line. The program accepts the following command-line arguments: &lt;/P&gt;
&lt;DIV class=informaltable&gt;
&lt;TABLE border=1&gt;
&lt;COLGROUP&gt;
&lt;COL&gt;
&lt;COL&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;&lt;I&gt;path&lt;/I&gt; &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;The pathname of a shared memory segment (file) that exists or that is to be created.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-p &lt;I&gt;perms&lt;/I&gt; &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;The access permissions to apply to a newly-created segment, for example -p&amp;nbsp;0664.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-s &lt;I&gt;bytes&lt;/I&gt; &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;The initial size at which to map the segment, for example -s 0x80000.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-c&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Use the O_CREAT flag with &lt;TT&gt;open()&lt;/TT&gt;, creating the segment if it doesn't exist.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-x &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Use the O_EXCL flag with &lt;TT&gt;open()&lt;/TT&gt;, requiring the segment to not exist.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-t&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Use the O_TRUNC flag with &lt;TT&gt;open()&lt;/TT&gt;, truncating the file to zero length.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-r&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Use the O_RDONLY flag with &lt;TT&gt;open()&lt;/TT&gt; and PROT_READ with &lt;TT&gt;mmap()&lt;/TT&gt;. If this option is not used, the program uses O_RDWR with &lt;TT&gt;open()&lt;/TT&gt; and PROT_READ, PROT_WRITE, PROT_AUTOGROW with &lt;TT&gt;mmap()&lt;/TT&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;-w&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Wait for keyboard input before exiting, allowing you to run other copies of the program while this one has the segment mapped.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P&gt;To create a segment named &lt;TT&gt;/var/tmp/test.seg&lt;/TT&gt;, use a command such as&lt;/P&gt;
&lt;TABLE cellPadding=10 width="90%" bgColor=#e0e0e0 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;PRE class=literallayout&gt;shm_open -c -x -p 0644 -s 0x80000 /var/tmp/test.seg
&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;To attach that segment read-only and then wait, use the command&lt;/P&gt;
&lt;TABLE cellPadding=10 width="90%" bgColor=#e0e0e0 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;PRE class=literallayout&gt;shm_open -r -w /var/tmp/test.seg
&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;From a different terminal window, enter the command&lt;/P&gt;
&lt;TABLE cellPadding=10 width="90%" bgColor=#e0e0e0 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;PRE class=literallayout&gt;shm_open /var/tmp/test.seg
&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;In the original window, press &amp;lt;Enter&amp;gt; and observe that the value of the first word of the shared segment changed during the wait. &lt;/P&gt;
&lt;DIV class=example&gt;
&lt;P&gt;&lt;A name=id5467389&gt;&lt;/A&gt;&lt;B&gt;Example 3-1. &lt;A name=id23511&gt;&lt;/A&gt;POSIX Program to Demonstrate shm_open()&lt;/B&gt;&lt;/P&gt;
&lt;TABLE cellPadding=10 width="90%" bgColor=#e0e0e0 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;PRE class=literallayout&gt;/*
||  Program&amp;nbsp;to&amp;nbsp;test&amp;nbsp;shm_open(3).
||      shm_open    [-p&amp;nbsp;&amp;lt;perms&amp;gt;]&amp;nbsp;[-s&amp;nbsp;&amp;lt;bytes&amp;gt;]&amp;nbsp;[-c]&amp;nbsp;[-x]&amp;nbsp;[-r]&amp;nbsp;[-t]&amp;nbsp;[-w]&amp;nbsp;&amp;lt;path&amp;gt;
||      -p&amp;nbsp;&amp;lt;perms&amp;gt;  access&amp;nbsp;mode&amp;nbsp;to&amp;nbsp;use&amp;nbsp;when&amp;nbsp;creating,&amp;nbsp;default&amp;nbsp;0600
||      -s&amp;nbsp;&amp;lt;bytes&amp;gt;  size&amp;nbsp;of&amp;nbsp;segment&amp;nbsp;to&amp;nbsp;map,&amp;nbsp;default&amp;nbsp;64K
||      -c          use&amp;nbsp;O_CREAT
||      -x          use&amp;nbsp;O_EXCL
||      -r          use&amp;nbsp;O_RDONLY,&amp;nbsp;default&amp;nbsp;is&amp;nbsp;O_RDWR
||      -t          use&amp;nbsp;O_TRUNC
||      -w          wait&amp;nbsp;for&amp;nbsp;keyboard&amp;nbsp;input&amp;nbsp;before&amp;nbsp;exiting
||      &amp;lt;path&amp;gt;      the&amp;nbsp;pathname&amp;nbsp;of&amp;nbsp;the&amp;nbsp;queue,&amp;nbsp;required
*/
#include&amp;nbsp;&amp;lt;sys/mman.h&amp;gt;  &amp;nbsp;/*&amp;nbsp;shared&amp;nbsp;memory&amp;nbsp;and&amp;nbsp;mmap()&amp;nbsp;*/
#include&amp;nbsp;&amp;lt;unistd.h&amp;gt;    &amp;nbsp;/*&amp;nbsp;for&amp;nbsp;getopt()&amp;nbsp;*/
#include&amp;nbsp;&amp;lt;errno.h&amp;gt;      /*&amp;nbsp;errno&amp;nbsp;and&amp;nbsp;perror&amp;nbsp;*/
#include&amp;nbsp;&amp;lt;fcntl.h&amp;gt;      /*&amp;nbsp;O_flags&amp;nbsp;*/
#include&amp;nbsp;&amp;lt;stdio.h&amp;gt;
int&amp;nbsp;main(int&amp;nbsp;argc,&amp;nbsp;char&amp;nbsp;**argv)
{
    int&amp;nbsp;perms&amp;nbsp;=&amp;nbsp;0600;          &amp;nbsp;/*&amp;nbsp;permissions&amp;nbsp;*/
    size_t&amp;nbsp;size&amp;nbsp;=&amp;nbsp;65536;        /*&amp;nbsp;segment&amp;nbsp;size&amp;nbsp;*/
    int&amp;nbsp;oflags&amp;nbsp;=&amp;nbsp;0;            &amp;nbsp;/*&amp;nbsp;open&amp;nbsp;flags&amp;nbsp;receives&amp;nbsp;-c,&amp;nbsp;-x,&amp;nbsp;-t&amp;nbsp;*/
    int&amp;nbsp;ropt&amp;nbsp;=&amp;nbsp;0;              &amp;nbsp;/*&amp;nbsp;-r&amp;nbsp;option&amp;nbsp;seen&amp;nbsp;*/
    int&amp;nbsp;wopt&amp;nbsp;=&amp;nbsp;0;              &amp;nbsp;/*&amp;nbsp;-w&amp;nbsp;option&amp;nbsp;seen&amp;nbsp;*/
    int&amp;nbsp;shm_fd;                &amp;nbsp;/*&amp;nbsp;file&amp;nbsp;descriptor&amp;nbsp;*/
    int&amp;nbsp;mprot&amp;nbsp;=&amp;nbsp;PROT_READ;      /*&amp;nbsp;protection&amp;nbsp;flags&amp;nbsp;to&amp;nbsp;mmap&amp;nbsp;*/
    int&amp;nbsp;mflags&amp;nbsp;=&amp;nbsp;MAP_SHARED;    /*&amp;nbsp;mmap&amp;nbsp;flags&amp;nbsp;*/
    void&amp;nbsp;*attach;              &amp;nbsp;/*&amp;nbsp;assigned&amp;nbsp;memory&amp;nbsp;adddress&amp;nbsp;*/
    char&amp;nbsp;*path;                &amp;nbsp;/*&amp;nbsp;-&amp;gt;first&amp;nbsp;non-option&amp;nbsp;argument&amp;nbsp;*/
    int&amp;nbsp;c;
    while&amp;nbsp;(&amp;nbsp;-1&amp;nbsp;!=&amp;nbsp;(c&amp;nbsp;=&amp;nbsp;getopt(argc,argv,"p:s:cxrtw"))&amp;nbsp;)
    {
        switch&amp;nbsp;(c)
        {
        case&amp;nbsp;'p':&amp;nbsp;/*&amp;nbsp;permissions&amp;nbsp;*/
            perms&amp;nbsp;=&amp;nbsp;(int)&amp;nbsp;strtoul(optarg,&amp;nbsp;NULL,&amp;nbsp;0);
            break;
        case&amp;nbsp;'s':&amp;nbsp;/*&amp;nbsp;segment&amp;nbsp;size&amp;nbsp;*/
            size&amp;nbsp;=&amp;nbsp;(size_t)&amp;nbsp;strtoul(optarg,&amp;nbsp;NULL,&amp;nbsp;0);
            break;
        case&amp;nbsp;'c':&amp;nbsp;/*&amp;nbsp;use&amp;nbsp;O_CREAT&amp;nbsp;*/
            oflags&amp;nbsp;|=&amp;nbsp;O_CREAT;
            break;
        case&amp;nbsp;'x':&amp;nbsp;/*&amp;nbsp;use&amp;nbsp;O_EXCL&amp;nbsp;*/
            oflags&amp;nbsp;|=&amp;nbsp;O_EXCL;
            break;
        case&amp;nbsp;'t':&amp;nbsp;/*&amp;nbsp;use&amp;nbsp;O_TRUNC&amp;nbsp;*/
            oflags&amp;nbsp;|=&amp;nbsp;O_TRUNC;
            break;
        case&amp;nbsp;'r':&amp;nbsp;/*&amp;nbsp;use&amp;nbsp;O_RDONLY&amp;nbsp;*/
            ropt&amp;nbsp;=&amp;nbsp;1;
            break;
        case&amp;nbsp;'w':&amp;nbsp;/*&amp;nbsp;wait&amp;nbsp;after&amp;nbsp;attaching&amp;nbsp;*/
            wopt&amp;nbsp;=&amp;nbsp;1;
            break;
        default:&amp;nbsp;/*&amp;nbsp;unknown&amp;nbsp;or&amp;nbsp;missing&amp;nbsp;argument&amp;nbsp;*/
            return&amp;nbsp;-1;      
        }&amp;nbsp;/*&amp;nbsp;switch&amp;nbsp;*/
    }&amp;nbsp;/*&amp;nbsp;while&amp;nbsp;*/
    if&amp;nbsp;(optind&amp;nbsp;&amp;lt;&amp;nbsp;argc)
        path&amp;nbsp;=&amp;nbsp;argv[optind];&amp;nbsp;/*&amp;nbsp;first&amp;nbsp;non-option&amp;nbsp;argument&amp;nbsp;*/
    else
        {&amp;nbsp;printf("Segment&amp;nbsp;pathname&amp;nbsp;required\n");&amp;nbsp;return&amp;nbsp;-1;&amp;nbsp;}
    if&amp;nbsp;(0==ropt)
    {&amp;nbsp;/*&amp;nbsp;read-write&amp;nbsp;access,&amp;nbsp;reflect&amp;nbsp;in&amp;nbsp;mprot&amp;nbsp;and&amp;nbsp;mflags&amp;nbsp;*/
        oflags&amp;nbsp;|=&amp;nbsp;O_RDWR;
        mprot&amp;nbsp;|=&amp;nbsp;PROT_WRITE;
        mflags&amp;nbsp;|=&amp;nbsp;MAP_AUTOGROW&amp;nbsp;+&amp;nbsp;MAP_AUTORESRV;    &amp;nbsp;
    }
    else
    {&amp;nbsp;/*&amp;nbsp;read-only&amp;nbsp;access,&amp;nbsp;mprot&amp;nbsp;and&amp;nbsp;mflags&amp;nbsp;defaults&amp;nbsp;ok&amp;nbsp;*/
        oflags&amp;nbsp;|=&amp;nbsp;O_RDONLY;
    }
    shm_fd&amp;nbsp;=&amp;nbsp;shm_open(path,oflags,perms);
    if&amp;nbsp;(-1&amp;nbsp;!=&amp;nbsp;shm_fd)
    {
        attach&amp;nbsp;=&amp;nbsp;mmap(NULL,size,mprot,mflags,shm_fd,(off_t)0);
        if&amp;nbsp;(attach&amp;nbsp;!=&amp;nbsp;MAP_FAILED)&amp;nbsp;/*&amp;nbsp;mmap&amp;nbsp;worked&amp;nbsp;*/
        {
            printf("Attached&amp;nbsp;at&amp;nbsp;0x%lx,&amp;nbsp;first&amp;nbsp;word&amp;nbsp;=&amp;nbsp;0x%lx\n",
                                attach,      *((pid_t*)attach));
            if&amp;nbsp;(mprot&amp;nbsp;&amp;amp;&amp;nbsp;PROT_WRITE)
            {
                *((pid_t&amp;nbsp;*)attach)&amp;nbsp;=&amp;nbsp;getpid();
                printf("Set&amp;nbsp;first&amp;nbsp;word&amp;nbsp;to&amp;nbsp;0x%lx\n",*((pid_t*)attach));
            }
            if&amp;nbsp;(wopt)&amp;nbsp;/*&amp;nbsp;wait&amp;nbsp;a&amp;nbsp;while,&amp;nbsp;report&amp;nbsp;possibly-different&amp;nbsp;value&amp;nbsp;*/
            {
                char&amp;nbsp;inp[80];
                printf("Waiting&amp;nbsp;for&amp;nbsp;return&amp;nbsp;key&amp;nbsp;before&amp;nbsp;unmapping...");
                gets(inp);
                printf("First&amp;nbsp;word&amp;nbsp;is&amp;nbsp;now&amp;nbsp;0x%lx\n",*((pid_t*)attach));
            }
            if&amp;nbsp;(munmap(attach,size))
                perror("munmap()");
        }
        else
            perror("mmap()");
    }
    else
        perror("shm_open()");
    return&amp;nbsp;errno;
}

 
&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H2 class=title&gt;&lt;A name=id5467510&gt;&lt;/A&gt;&lt;A name=id62381&gt;&lt;/A&gt;IRIX Shared Memory Arenas&lt;/H2&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;The shared memory arena is basic to all IRIX IPC mechanisms. IRIX semaphores, locks, and barriers are all represented as objects within a shared arena.&lt;A name=idTIP_2b.ipcsmem5&gt;&lt;/A&gt;&lt;/P&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5467530&gt;&lt;/A&gt;Overview of Shared Arenas&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;A shared arena is a segment of memory that can be made part of the address space of more than one process. Each shared arena is associated with a disk file that acts as a backing store for the file (see &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch01.html#id31393"&gt;&amp;#8220;Page Validation&amp;#8221;&lt;/A&gt;). Each process that wants to share access to the arena does so by specifying the file pathname of the file. The file pathname acts as the public name of the memory segment. The file access permissions determine which user IDs and group IDs can share the file.&lt;/P&gt;
&lt;P&gt;The functions you use to manage a shared arena are discussed in the following topics and are summarized in &lt;A href="http://biology.ncsa.uiuc.edu/library/SGI_bookshelves/SGI_Developer/books/T_IRIX_Prog/sgi_html/ch03.html#id33022"&gt;Table&amp;nbsp;3-2&lt;/A&gt;. &lt;/P&gt;
&lt;DIV class=table&gt;
&lt;P&gt;&lt;A name=id5467570&gt;&lt;/A&gt;&lt;B&gt;Table 3-2. &lt;A name=id33022&gt;&lt;/A&gt;IRIX Shared Arena Management Functions&lt;/B&gt;&lt;/P&gt;
&lt;TABLE summary=" IRIX Shared Arena Management Functions" border=1&gt;
&lt;COLGROUP&gt;
&lt;COL&gt;
&lt;COL&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR vAlign=top&gt;
&lt;TH vAlign=top scope=col&gt;
&lt;P&gt;Function Name&lt;/P&gt;&lt;/TH&gt;
&lt;TH vAlign=top scope=col&gt;
&lt;P&gt;Purpose and Operation&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;usconfig(3) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Establish the default size of an arena, the number of concurrent processes that can use it, and the features of IPC objects in it.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;usinit(3) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Create an arena or join an existing arena.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR vAlign=top&gt;
&lt;TD vAlign=top scope=row&gt;
&lt;P&gt;usadd(3) &lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;
&lt;P&gt;Join an existing arena.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;DIV class=section&gt;
&lt;DIV class=titlepage&gt;
&lt;DIV&gt;
&lt;H3 class=title&gt;&lt;A name=id5467722&gt;&lt;/A&gt;&lt;A name=id19447&gt;&lt;/A&gt;Initializing Arena Attributes&lt;/H3&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;A program creates a shared memory arena with the &lt;A name=idTIP_2b.ipcsmem6&gt;&lt;/A&gt;&lt;TT&gt;usinit()&lt;/TT&gt; function. However, many attributes of a new arena are set by preceding calls to &lt;TT&gt;usconfig()&lt;/TT&gt;. The normal sequence of operations is to make several calls to &lt;TT&gt;usconfig()&lt;/TT&gt; to establish arena attributes, then to make one call to &lt;TT&gt;usinit()&lt;/TT&gt; to create the arena.&lt;/P&gt;
&lt;P&gt;You call &lt;TT&gt;usconfig() 