﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><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>C++博客-。。。。。。。。。。-随笔分类-ACE</title><link>http://www.cppblog.com/loky/category/6638.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 13 Mar 2009 22:15:17 GMT</lastBuildDate><pubDate>Fri, 13 Mar 2009 22:15:17 GMT</pubDate><ttl>60</ttl><item><title>ACE的安装</title><link>http://www.cppblog.com/loky/archive/2008/12/26/70476.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Fri, 26 Dec 2008 15:57:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/12/26/70476.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/70476.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/12/26/70476.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/70476.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/70476.html</trackback:ping><description><![CDATA[*************构建ACE： &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 1、下载，解压缩ACE包，设置环境变量PATH包含$ACE_ROOT$/bin &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 2、设置$ACE_ROOT$/ace/config.h，加入一行：（该语句是ACE针对WIN32平台的配置文件） &nbsp; <br> &nbsp; #include &nbsp; "ace/config-win32.h" &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 注意： &nbsp; <br> &nbsp; A、如果你使用9x/Me，加入： &nbsp; <br> &nbsp; #define &nbsp; ACE_HAS_WINNT4 &nbsp; 0 &nbsp; <br> &nbsp; B、如果你要使用标准C++头文件的话 &nbsp; <br> &nbsp; #define &nbsp; ACE_HAS_STANDARD_CPP_LIBRARY &nbsp; 1 &nbsp; <br> &nbsp; C、要使用MFC的话 &nbsp; <br> &nbsp; #define &nbsp; ACE_HAS_MFC &nbsp; 1 &nbsp; <br> &nbsp; 以上的define语句都要在#include &nbsp; "ace/config-win32.h"之前包含 &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 3、VC6打开$ACE_ROOT$/ace/ace.dsw，VC.net打开$ACE_ROOT$/ace/ace/ace.sln，构建ACE &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 4、构建成功与否，可打开$ACE_ROOT$/tests下的工程文件看看能不能编译通过 &nbsp; <br> &nbsp;  &nbsp; <br>
&nbsp;
其实，如果你初学ACE的话，暂时还不想涉及上面烦琐的步骤的话，可以找一个.exe安装包，安装完成之后，打开ace.dsw/ace.sln即可构建
了；偶开始学ACE的时候，就是使用《ACE程序员指南 &nbsp; &nbsp; 网络与系统编程的实用设计模式》书后自带光盘中ACE53b.exe安装、构建的。
&nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; **************在你的程序中使用ACE方法：打开项目--&gt;设置： &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; C/C++选项卡 &nbsp; <br> &nbsp; 	Code &nbsp; Generation：选择多线程版的运行时库（如：Debug &nbsp; Multithreaded &nbsp; DLL） &nbsp; <br> &nbsp; 	Proprocessor：在&#8220;附加包含路径&#8221;中包含$ACE_ROOT$ &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; Link选项卡 &nbsp; <br> &nbsp; 	Input：在&#8220;对象/库模块&#8221;包含适当的ACE库文件名（附表A） &nbsp; <br> &nbsp; 		加上.lib，如：aced.lib,acesd.lib等 &nbsp; <br> &nbsp; 	Input：在&#8220;附加库路径&#8221;中包含$ACE_ROOT$/ace &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; **************附表A： &nbsp; <br> &nbsp; ----------------------------------------------------------- &nbsp; <br> &nbsp; 配置			文件名 &nbsp; <br> &nbsp; ----------------------------------------------------------- &nbsp; <br> &nbsp; DLL &nbsp; debug		aced &nbsp; <br> &nbsp; DLL &nbsp; release		ace &nbsp; <br> &nbsp; Static &nbsp; library &nbsp; debug	acesd &nbsp; <br> &nbsp; Static &nbsp; library &nbsp; release	aces &nbsp; <br> &nbsp; MFC &nbsp; DLL &nbsp; debug		acemfcd &nbsp; <br> &nbsp; MFC &nbsp; DLL &nbsp; release		acemfc &nbsp; <br> &nbsp; ----------------------------------------------------------- &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 英文比较好的，可直接查看$ACE_ROOT$/ACE-INSTALL.html#msvc<br><br>ACE环境构建笔记(Linux) &nbsp; :) &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; **************构建ACE************** &nbsp; <br> &nbsp;  &nbsp; <br>
&nbsp;
1：下载ACE源码包。我下的是5.4版的，文件名为ACE54SRC.tar.gz。gzip解压，tar解包后，得到一个叫ACE_wrappers
的目录，我把它放在/home/lok/ace目录下。注意如果我没有特别说明，所有操作都是在一般用户下进行的。 &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 2：编译前的必要工作。 &nbsp; <br> &nbsp; 设置环境变量，在shell下输入：ACE_ROOT=/home/lok/ace/ACE_wrappers; &nbsp; export &nbsp; ACE_ROOT &nbsp; <br> &nbsp; (注意上面的操作是在同一行中执行的，如果要分行，可以不用分号)。这样设置的变量只是临时的，如果想要永久保存这个变量，可以切换到root，把变量写到文件/etc/profile中； &nbsp; <br> &nbsp; 在$ACE_ROOT/ace目录下新建一个config.h文件，内容为：#include &nbsp; "ace/config-linux.h" &nbsp; <br>
&nbsp;
在$ACE_ROOT/include/makeinclude目录下新建一个platform_macros.GNU文件，内容为：include
&nbsp; $(ACE_ROOT)/include/makeinclude/platform_linux.GNU &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 3：在$ACE_ROOT目录下，新建一个目录，用以执行configure的结果<br>&nbsp; mkdir aaa<br>&nbsp; cd aaa<br>在$ACE_ROOT/aaa中运行<br>&nbsp; ../configure<br>在确认结果无误后，执行 <br>&nbsp; make<br> &nbsp;  &nbsp; <br> &nbsp; 4：切换到root用户，把刚生成的libACE.so和libACE.so.5.4.0(在$ACE_ROOT/ace目录下)拷贝到/usr/lib，ACE开发环境构建完毕！ &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; **************写个小程序测试ACE************** &nbsp; <br> &nbsp; 1：编写Log_Msg.cpp，内容如下： &nbsp; <br> &nbsp; #include &nbsp; "ace/Log_Msg.h" &nbsp; <br> &nbsp; void &nbsp; foo &nbsp; (void); &nbsp; <br> &nbsp; int &nbsp; ACE_TMAIN &nbsp; (int, &nbsp; ACE_TCHAR &nbsp; *[]) &nbsp; <br> &nbsp; { &nbsp; <br> &nbsp;  &nbsp;  &nbsp; ACE_TRACE(ACE_TEXT &nbsp; ("main")); &nbsp; <br> &nbsp;  &nbsp;  &nbsp; ACE_DEBUG &nbsp; ((LM_INFO, &nbsp; ACE_TEXT &nbsp; ("%IHi &nbsp; Mom\n"))); &nbsp; <br> &nbsp;  &nbsp;  &nbsp; foo(); &nbsp; <br> &nbsp;  &nbsp;  &nbsp; ACE_DEBUG &nbsp; ((LM_INFO, &nbsp; ACE_TEXT &nbsp; ("%IGoodnight\n"))); &nbsp; <br> &nbsp;  &nbsp;  &nbsp; return &nbsp; 0; &nbsp; <br> &nbsp; } &nbsp; <br> &nbsp; void &nbsp; foo &nbsp; (void) &nbsp; <br> &nbsp; { &nbsp; <br> &nbsp;  &nbsp;  &nbsp; ACE_TRACE &nbsp; (ACE_TEXT &nbsp; ("foo")); &nbsp; <br> &nbsp;  &nbsp;  &nbsp; ACE_DEBUG &nbsp; ((LM_INFO, &nbsp; ACE_TEXT &nbsp; ("%IHowdy &nbsp; Pardner\n"))); &nbsp; <br> &nbsp; } &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 2：写makefile，内容如下： &nbsp; <br> &nbsp; LIB	= &nbsp; -lACE &nbsp; <br> &nbsp; LIBPATH	= &nbsp; -L$(ACE_ROOT)/ace &nbsp; <br> &nbsp; HPATH	= &nbsp; -I$(ACE_ROOT) &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; Log_Msg	: &nbsp; Log_Msg.cpp &nbsp; <br> &nbsp; 	g++ &nbsp; Log_Msg.cpp &nbsp; -o &nbsp; Log_Msg &nbsp; $(LIB) &nbsp; $(LIBPATH) &nbsp; $(HPATH) &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; 3：make，运行Log_Msg，测试完毕！ &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp; ***************补充************* &nbsp; <br>
&nbsp;
$(ACE_ROOT)/example下有很多例子可以参考，但你会发现它们的makefile写得很奇怪，这是因为这些makefile是由程序自动
生成的，目的是让它们可以在不同系统下都可正常工作。关于这些makefile，可以到http://www.kehui.net
/index.php?op=article&amp;file=read&amp;aid=30812去看一下。如果你的程序只需要在linux下工
作，那只要自己写上-lACE就可以了。&nbsp; <br>
<br> <img src ="http://www.cppblog.com/loky/aggbug/70476.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-12-26 23:57 <a href="http://www.cppblog.com/loky/archive/2008/12/26/70476.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ACE Documentation</title><link>http://www.cppblog.com/loky/archive/2008/08/19/59338.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Tue, 19 Aug 2008 06:42:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/08/19/59338.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/59338.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/08/19/59338.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/59338.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/59338.html</trackback:ping><description><![CDATA[ACE类库<a href="http://www.dre.vanderbilt.edu/Doxygen/Current/html/ace/index.html"><br>http://www.dre.vanderbilt.edu/Doxygen/Current/html/ace/index.html</a>
<img src ="http://www.cppblog.com/loky/aggbug/59338.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-08-19 14:42 <a href="http://www.cppblog.com/loky/archive/2008/08/19/59338.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ACE中的Double Checked Locking 模式 --转贴</title><link>http://www.cppblog.com/loky/archive/2008/08/15/58953.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Fri, 15 Aug 2008 09:42:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/08/15/58953.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/58953.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/08/15/58953.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/58953.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/58953.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1、标准的单例。开发正确的有效的并发应用是困难的。程序员必须学习新的技术（并发控制和防止死锁的算法）和机制（如多线程和同步API）。此外，许多熟悉的设计模式（如单例和迭代子）在包含不使用任何并发上下文假设的顺序程序中可以工作的很好。为了说明这点，考虑一个标准的单例模式在多线程环境下的实现。单例模式保证一个类仅有一个实例同时提供了全局唯一的访问这个实例的入口点。在c++程序中动态分配单例对象是通用的方式，这是因为c++程序没有很好的定义静态全局对象的初始化次序，因此是不可移植的。而且，动态分配避免了单例对象在永远没有被使用情况下的初始化开销。&nbsp;&nbsp;<a href='http://www.cppblog.com/loky/archive/2008/08/15/58953.html'>阅读全文</a><img src ="http://www.cppblog.com/loky/aggbug/58953.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-08-15 17:42 <a href="http://www.cppblog.com/loky/archive/2008/08/15/58953.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ACE程序入口main?</title><link>http://www.cppblog.com/loky/archive/2008/04/07/46462.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Mon, 07 Apr 2008 14:15:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/04/07/46462.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/46462.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/04/07/46462.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/46462.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/46462.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 用过ACE的都知道，我们的主函数被改写了，加入了初始化的动作。主函数是被宏替换的。<br>下面我们一层层找出ACE背后是如可帮我们初始化的。&nbsp;&nbsp;<a href='http://www.cppblog.com/loky/archive/2008/04/07/46462.html'>阅读全文</a><img src ="http://www.cppblog.com/loky/aggbug/46462.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-04-07 22:15 <a href="http://www.cppblog.com/loky/archive/2008/04/07/46462.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>