<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Erlang非业余研究 &#187; 网络编程</title>
	<atom:link href="http://blog.yufeng.info/archives/category/network/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yufeng.info</link>
	<description>Erlang系统深度探索和应用</description>
	<lastBuildDate>Tue, 07 Sep 2010 07:17:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>来自RHEL系统调优手册的几张经典图</title>
		<link>http://blog.yufeng.info/archives/617</link>
		<comments>http://blog.yufeng.info/archives/617#comments</comments>
		<pubDate>Tue, 20 Jul 2010 01:46:51 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[杂七杂八]]></category>
		<category><![CDATA[网络编程]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=617</guid>
		<description><![CDATA[看图不说话：） IO架构图： 内存管理图： 很容易误解的socket buffer：]]></description>
			<content:encoded><![CDATA[<p>看图不说话：）</p>
<p>IO架构图：<br />
<a href="http://blog.yufeng.info/wp-content/uploads/2010/07/IO_subsystem_architecture.jpg"><img src="http://blog.yufeng.info/wp-content/uploads/2010/07/IO_subsystem_architecture-300x291.jpg" alt="" title="IO_subsystem_architecture" width="300" height="291" class="alignnone size-medium wp-image-620" /></a></p>
<p>内存管理图：<br />
<a href="http://blog.yufeng.info/wp-content/uploads/2010/07/Linux_virtual_memory_manager.jpg"><img src="http://blog.yufeng.info/wp-content/uploads/2010/07/Linux_virtual_memory_manager-300x197.jpg" alt="" title="Linux_virtual_memory_manager" width="300" height="197" class="alignnone size-medium wp-image-619" /></a></p>
<p>很容易误解的socket buffer：<br />
<a href="http://blog.yufeng.info/wp-content/uploads/2010/07/socket_buffer_memory_allocation.jpg"><img src="http://blog.yufeng.info/wp-content/uploads/2010/07/socket_buffer_memory_allocation-300x253.jpg" alt="" title="socket_buffer_memory_allocation" width="300" height="253" class="alignnone size-medium wp-image-618" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/617/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>非阻塞connect的一个细节</title>
		<link>http://blog.yufeng.info/archives/565</link>
		<comments>http://blog.yufeng.info/archives/565#comments</comments>
		<pubDate>Tue, 18 May 2010 05:04:02 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[Erlang探索]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[SOL_SOCKET]]></category>
		<category><![CDATA[SO_ERROR]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=565</guid>
		<description><![CDATA[昨天听zhuzhaoyuan说的一个connect细节. 通常我们connect的时候都是非阻塞的, 在connect调用后把句柄挂到poll去, 等poll通知可写的时候, 我们就认为connect成功了. 但是在linux平台下实际上不一定成功, 具体的要用socket get_opt来检查下出错码来决定. 以下是从man 2 connnect摘抄的: EINPROGRESS The socket(2,7,n) is non-blocking and the connection cannot be com- pleted immediately. It is possible to select(2,7,2 select_tut)(2) or poll(2) for completion by selecting the socket(2,7,n) for writing. After select(2,7,2 select_tut) indicates writability, use getsockopt(2) to read(2,n,1 builtins) the SO_ERROR option at level [...]]]></description>
			<content:encoded><![CDATA[<p>昨天听zhuzhaoyuan说的一个connect细节. 通常我们connect的时候都是非阻塞的, 在connect调用后把句柄挂到poll去, 等poll通知可写的时候, 我们就认为connect成功了. 但是在linux平台下实际上不一定成功, 具体的要用socket get_opt来检查下出错码来决定.</p>
<p>以下是从man 2 connnect摘抄的:</p>
<blockquote><p> EINPROGRESS<br />
              The socket(2,7,n) is non-blocking and the  connection  cannot  be  com-<br />
              pleted  immediately.  It is possible to select(2,7,2 select_tut)(2) or poll(2) for<br />
              completion by selecting the socket(2,7,n)  for  writing.  After  select(2,7,2 select_tut)<br />
              indicates  writability,  use  getsockopt(2) to read(2,n,1 builtins) the SO_ERROR<br />
              option at level SOL_SOCKET to  determine  whether  connect  com-<br />
              pleted   successfully   (SO_ERROR  is  zero)  or  unsuccessfully<br />
              (SO_ERROR is one of the usual error(8,n) codes listed here,  explain-<br />
              ing the reason for the failure).</p></blockquote>
<p>我们看下erlang的inet_drv是如何处理的.<br />
./erts/emulator/drivers/common/inet_drv.c:</p>
<pre class="brush: cpp;">
        {
            int error = 0;      /* Has to be initiated, we check it */
            unsigned int sz = sizeof(error); /* even if we get -1 */
            int code = sock_getopt(desc-&gt;inet.s, SOL_SOCKET, SO_ERROR,
                                   (void *)&amp;error, &amp;sz);

            if ((code &lt; 0) || error) {
                desc-&gt;inet.state = TCP_STATE_BOUND;  /* restore state */
                ret = async_error(INETP(desc), error);
                goto done;
            }
        }
</pre>
<p>结论: 细节决定品质.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/565/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>看图学TCP API以及状态变迁</title>
		<link>http://blog.yufeng.info/archives/203</link>
		<comments>http://blog.yufeng.info/archives/203#comments</comments>
		<pubDate>Thu, 28 Jan 2010 02:42:31 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>
		<category><![CDATA[shift]]></category>
		<category><![CDATA[State]]></category>
		<category><![CDATA[TCP]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=203</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.yufeng.info/wp-content/uploads/2010/01/ddvshrpj_18c4drttfv.png"><img src="http://blog.yufeng.info/wp-content/uploads/2010/01/ddvshrpj_18c4drttfv-202x300.png" alt="" title="ddvshrpj_18c4drttfv"  class="alignnone size-medium wp-image-202" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/203/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用systemtap来修改下linux内核变量的值</title>
		<link>http://blog.yufeng.info/archives/102</link>
		<comments>http://blog.yufeng.info/archives/102#comments</comments>
		<pubDate>Thu, 29 Oct 2009 11:07:20 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>
		<category><![CDATA[-g]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[guru]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[stap]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=102</guid>
		<description><![CDATA[我们在探索linux内核的时候，经常需要调整下变量的值，看它对系统的影响。如果这个值没有透过/proc来修改的话，那只能编译内核。这个步骤是非常繁琐的。现在我们有systemtap这个利器来帮忙了。 演示如下： 我们通过修改过 extern int sysctl_tcp_fin_timeout;的值来达到目的。是因为这个值是proc导出的 我们好验证是否成功。 root@localhost ~]# cat /proc/sys/net/ipv4/tcp_fin_timeout 15000 [root@localhost ~]# cat test.stp probe begin { printf(&#34;ready go\n&#34;); } probe kernel.function(&#34;do_tcp_setsockopt&#34;) { $sysctl_tcp_fin_timeout = $1 printf(&#34;sysctl_tcp_fin_timeout = %d\n&#34;, $sysctl_tcp_fin_timeout); exit() } [root@localhost ~]# stap -g test.stp 18000 ready go 这个时候 stap在运行， 只是还没有触发do_tcp_setsockopt. 现在我们来触发 [root@localhost ~]# erl Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [...]]]></description>
			<content:encoded><![CDATA[<p>我们在探索linux内核的时候，经常需要调整下变量的值，看它对系统的影响。如果这个值没有透过/proc来修改的话，那只能编译内核。这个步骤是非常繁琐的。现在我们有systemtap这个利器来帮忙了。</p>
<p>演示如下：<br />
我们通过修改过<br />
extern int sysctl_tcp_fin_timeout;的值来达到目的。是因为这个值是proc导出的 我们好验证是否成功。</p>
<pre class="brush: bash;">
root@localhost ~]# cat /proc/sys/net/ipv4/tcp_fin_timeout
15000
[root@localhost ~]# cat test.stp
probe begin
{
        printf(&quot;ready go\n&quot;);
}

probe kernel.function(&quot;do_tcp_setsockopt&quot;)
{
        $sysctl_tcp_fin_timeout = $1
        printf(&quot;sysctl_tcp_fin_timeout = %d\n&quot;, $sysctl_tcp_fin_timeout);
        exit()
}

[root@localhost ~]# stap -g test.stp 18000
ready go
</pre>
<p>这个时候 stap在运行， 只是还没有触发do_tcp_setsockopt.<br />
现在我们来触发</p>
<pre class="brush: bash;">
[root@localhost ~]# erl
Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.3  (abort with ^G)
1&gt; {ok, LSock} = gen_tcp:listen(0, []).
{ok,#Port&lt;0.437&gt;}
2&gt;
2&gt; inet:setopts(LSock, [{nodelay,true}]).
ok
3&gt;
</pre>
<p>Ok,这时候回头可以看到stap打出来以下：<br />
sysctl_tcp_fin_timeout = 18000</p>
<p>我们来验证下：</p>
<pre class="brush: bash;">
root@localhost ~]# cat /proc/sys/net/ipv4/tcp_fin_timeout
18000
</pre>
<p>OK,成功。</p>
<p>Tips：<br />
1. stap对全局变量的写需要-g guru模式。<br />
2. 全局变量必须在一个单元内的函数里面才可以修改， 而且必须是在内核上下文。 </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/102/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JVM 64位pointer compress, Erlang呢？</title>
		<link>http://blog.yufeng.info/archives/40</link>
		<comments>http://blog.yufeng.info/archives/40#comments</comments>
		<pubDate>Sun, 11 Oct 2009 05:57:11 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>
		<category><![CDATA[64 pointer]]></category>
		<category><![CDATA[compress]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=40</guid>
		<description><![CDATA[前端时间看到JVM的 64 pointer compress技术，蛮多感慨的。具体的可以 google 64位 pointer compress 来了解更多。 好不容易从32位系统中逃脱，解决了4G内存的问题，而且64位的cpu更多的寄存器，可以带来更好的性能。但是怎么又碰到问题了。64位的系统，64位的指针，意味着更多的数据访问， cpu速度是提高了，但是内存的带宽和访问速度没有大的提高。而且内存的访问速度和cpu的cycle差几个数量级别，所以对于普通的网络程序来讲，大部分是处理信息的变形，也就是说是把内存里面的数据从一个形式变成另外一个形式。 cpu性能的提高对这种程序来讲 影响不是很大。倒是因为数据的量加大了1倍， 导致整体的性能降低了百分几十。实际的硬件系统也没有那么多内存，一般都是16G以下，所以才有人去想在64位系统下，用36位的指针，减少内存的访问。 erlang的系统基本上是个网络程序，所以这个问题就非常突出。 目前没看到otp vm的这方面的打算， 我还是乖乖的用我的32位系统]]></description>
			<content:encoded><![CDATA[<p>前端时间看到JVM的 64 pointer compress技术，蛮多感慨的。具体的可以 google<br />
64位 pointer compress 来了解更多。</p>
<p>好不容易从32位系统中逃脱，解决了4G内存的问题，而且64位的cpu更多的寄存器，可以带来更好的性能。但是怎么又碰到问题了。64位的系统，64位的指针，意味着更多的数据访问， cpu速度是提高了，但是内存的带宽和访问速度没有大的提高。而且内存的访问速度和cpu的cycle差几个数量级别，所以对于普通的网络程序来讲，大部分是处理信息的变形，也就是说是把内存里面的数据从一个形式变成另外一个形式。 cpu性能的提高对这种程序来讲 影响不是很大。倒是因为数据的量加大了1倍， 导致整体的性能降低了百分几十。实际的硬件系统也没有那么多内存，一般都是16G以下，所以才有人去想在64位系统下，用36位的指针，减少内存的访问。</p>
<p>erlang的系统基本上是个网络程序，所以这个问题就非常突出。 目前没看到otp vm的这方面的打算， 我还是乖乖的用我的32位系统</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>erlang的profile工具原理和优缺点</title>
		<link>http://blog.yufeng.info/archives/71</link>
		<comments>http://blog.yufeng.info/archives/71#comments</comments>
		<pubDate>Tue, 06 Oct 2009 04:56:10 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>

		<guid isPermaLink="false">http://mryufeng.javaeye.com/blog/482208</guid>
		<description><![CDATA[erlang的tools application下包含了一系列的profile工具， 包括 eprof cprof fprof， 具体的使用可以参看文档和>. 我这里要说的是他们的工作原理。 这些模块的核心都是根据erlang的trace机制实现的。在模块执行的时候，trace机制会通知那个函数被调用 返回。根据这些信息就可以统计出来函数调用的频度，调用栈等。 但是利用这个机制会有严重的性能损失。因为每个函数调用都要发送一条trace信息，每个trace 信息会引起上下文切换 而且要耗费2-3的时间。这个对大型的系统是不可接受的。 所以知道这些原理以后， 我们在profile大型的系统的时候，我们可以在dbg模块的帮助下， 只收集我们感兴趣的东西，而且严格限定范围，避免对系统造成大的干扰，这样收集出来的东西才有意义。]]></description>
			<content:encoded><![CDATA[<p>erlang的tools application下包含了一系列的profile工具， 包括 eprof cprof fprof， 具体的使用可以参看文档和<< erlang effective guide>>.</p>
<p>我这里要说的是他们的工作原理。 这些模块的核心都是根据erlang的trace机制实现的。在模块执行的时候，trace机制会通知那个函数被调用 返回。根据这些信息就可以统计出来函数调用的频度，调用栈等。</p>
<p>但是利用这个机制会有严重的性能损失。因为每个函数调用都要发送一条trace信息，每个trace 信息会引起上下文切换 而且要耗费2-3的时间。这个对大型的系统是不可接受的。</p>
<p>所以知道这些原理以后， 我们在profile大型的系统的时候，我们可以在dbg模块的帮助下， 只收集我们感兴趣的东西，而且严格限定范围，避免对系统造成大的干扰，这样收集出来的东西才有意义。 </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/71/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何用gdb调试erlang运行期（高级）</title>
		<link>http://blog.yufeng.info/archives/74</link>
		<comments>http://blog.yufeng.info/archives/74#comments</comments>
		<pubDate>Tue, 06 Oct 2009 03:52:24 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>

		<guid isPermaLink="false">http://mryufeng.javaeye.com/blog/482192</guid>
		<description><![CDATA[前些天在erlang的源码里面闲逛的时候发现了 bin目录下的cerl，一看原来是个调试的高级货。 我之前写过一篇文章http://mryufeng.javaeye.com/blog/113852 如何调试erlang 但是这是土八路的方法， cerl才是现代化工业。 # This is a script to start Erlang/OTP for debugging. PATH is set to # include this script so if slave nodes are started they will use this # script as well. # # usage: cerl [ OPTIONS ] [ ARGS ] # # The OPTIONS are # # [...]]]></description>
			<content:encoded><![CDATA[<p>前些天在erlang的源码里面闲逛的时候发现了 bin目录下的cerl，一看原来是个调试的高级货。</p>
<p>我之前写过一篇文章http://mryufeng.javaeye.com/blog/113852 如何调试erlang 但是这是土八路的方法， cerl才是现代化工业。</p>
<p># This is a script to start Erlang/OTP for debugging. PATH is set to<br />
# include this script so if slave nodes are started they will use this<br />
# script as well.<br />
#<br />
#  usage:  cerl [ OPTIONS ] [ ARGS ]<br />
#<br />
#  The OPTIONS are<br />
#<br />
#   -rootdir $MYROOTDIR<br />
#               Run an installed emulator built from this source<br />
#   -debug      Run debug compiled emulator<br />
#   -gdb        Run the debug compiled emulator in emacs and gdb.<br />
#               You have to start beam in gdb using &#8220;run&#8221;.<br />
#   -break F    Run the debug compiled emulator in emacs and gdb and set break.<br />
#               The session is started, i.e. &#8220;run&#8221; is already don for you.<br />
#   -xxgdb      FIXME currently disabled<br />
#   -purify     Run emulator compiled for purify<br />
#   -quantify   Run emulator compiled for quantify<br />
#   -purecov    Run emulator compiled for purecov<br />
#   -gcov       Run emulator compiled for gcov<br />
#   -valgrind   Run emulator compiled for valgrind<br />
#   -lcnt Run emulator compiled for lock counting<br />
#   -nox        Unset the DISPLAY variable to disable us of X Windows<br />
#</p>
<p>要使用cerl 我们最好准备个调试版本的erlang。R13B 修正了些编译错误,可以编译出debug版本的系统：./configure &#038;&#038; make TYPE＝debug &#038;&#038; make</p>
<p>这样就生成了个beam.debug的运行期。</p>
<p>我们要调试的时候 就可以在otp的binx目录下运行  cerl -debug -gdb -break main</p>
<p>这时候cerl自动会加载 emacs 启动 gud,  整个过程都是自动的。但是这个脚本有点小问题， gud模型下没有把源码和当前对应的调试对应起来。可以通过以下方式修正：</p>
<pre class="brush: bash;">
yu-fengdemacbook-2:bin yufeng$ diff cerl cerl2
284c284
&lt;     exec $EMACS --eval &quot;(progn (gdb \&quot;gdb $EMU\&quot;) $gdbcmd)&quot;
---
&gt;     exec $EMACS --eval &quot;(progn (gdb \&quot;gdb --annotate=3  $EMU\&quot;) $gdbcmd)&quot;
</pre>
<p>具体的操作和界面可以参照这篇文章：</p>
<p>http://www.nabble.com/printing-of-Eterm%27s-from-gdb-td19240493.html</p>
<p>在调试的时候 我们会希望查看 eterm的值，但是由于eterm的格式非常复杂， gdb的print什么的无法满足我们的需求。 otp开发团队于是开发出了一套方法来减轻我们的负担：</p>
<p>1.  erts/etc/unix/etp-commands 这是gdb的脚本 包含了几十个etp方法，而且文档非常详细。</p>
<p>2. 源码里面的 pp， ps等函数， 这些函数是专门为gdb调试开发的。 可以用gdb的 call pp(xxx)来调用。</p>
<p>有了这些工具 调试和研究erts变成了一件很快乐的事情！ </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Literal XML in Erlang with parse_transform/2</title>
		<link>http://blog.yufeng.info/archives/75</link>
		<comments>http://blog.yufeng.info/archives/75#comments</comments>
		<pubDate>Wed, 30 Sep 2009 13:09:34 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>

		<guid isPermaLink="false">http://mryufeng.javaeye.com/blog/481011</guid>
		<description><![CDATA[原文地址：http://hyperstruct.net/2007/6/26/literal-xml-in-erlang-with-parse-transform-2 One of the things I dislike about Erlang is that it severely impairs bragging opportunities. Yesterday I wrote a module that allows writing literal XML in the source and have it parsed into Erlang structures at compile time—sort of like E4X minus the manipulation goodies at runtime (at least for now). You write: Doc [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：<a href="http://hyperstruct.net/2007/6/26/literal-xml-in-erlang-with-parse-transform-2">http://hyperstruct.net/2007/6/26/literal-xml-in-erlang-with-parse-transform-2</a></p>
<p>One of the things I dislike about Erlang is that it severely impairs bragging opportunities. Yesterday I wrote a module that allows writing literal XML in the source and have it parsed into Erlang structures at compile time—sort of like E4X minus the manipulation goodies at runtime (at least for now).</p>
<p>You write:</p>
<pre class="brush: erlang;">
Doc = '&lt;greeting&gt;Hello!&lt;/greeting&gt;',
io:format(&quot;~p~n&quot;, [Doc]).
</pre>
<p>And it prints…</p>
<pre class="brush: erlang;">
{xmlElement,greeting,
            greeting,
            [],
            {xmlNamespace,[],[]},
            [],
            1,
            [],
            [{xmlText,[{greeting,1}],1,[],&quot;Hello!&quot;,text}],
            [],
            &quot;/tmp&quot;,
            undeclared}
</pre>
<p>In most languages I’m familiar with, this would have granted the author instant Yacc-demigod status. With Erlang… it was less than 40 LOC. Hardly something you’d wear at a party.</p>
<p>Anyway, this code owes everything to Philip’s writings. It also uses parse_transform/2, and “programmers are strongly advised not to engage in parse transformations and no support is offered for problems encountered”. So unless you, like me, are still at the kid-in-a-candy-shop stage of Erlang experience, think twice before using this in production, ok?</p>
<p>The code is here <a href="http://repo.hyperstruct.net/inline_xml/ ">http://repo.hyperstruct.net/inline_xml/ </a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/75/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>erlang的abstract code</title>
		<link>http://blog.yufeng.info/archives/76</link>
		<comments>http://blog.yufeng.info/archives/76#comments</comments>
		<pubDate>Wed, 30 Sep 2009 13:05:16 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>

		<guid isPermaLink="false">http://mryufeng.javaeye.com/blog/481009</guid>
		<description><![CDATA[erlang的abstract code是编译的中间代码，很多工具如 erl_pp lint什么的都是根据这个做调整的。还有进一步的parse_transform也是基于它的。 所以，了解它非常重要。 erts user guide里面详细了描述了它的定义。我这里展示的是如何获取到某个模块的abstract code 以便进一步研究： [root@localhost ~]# erl -s hello Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] hello world [root@localhost ~]# cat hello.erl -module(hello). -export([start/0]). start()-&#62; io:format(&#34;hello world~n&#34;,[]). [root@localhost ~]# erlc +debug_info hello.erl [root@localhost ~]# erl Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell [...]]]></description>
			<content:encoded><![CDATA[<p>erlang的abstract code是编译的中间代码，很多工具如 erl_pp lint什么的都是根据这个做调整的。还有进一步的parse_transform也是基于它的。 所以，了解它非常重要。 erts user guide里面详细了描述了它的定义。我这里展示的是如何获取到某个模块的abstract code 以便进一步研究：</p>
<pre class="brush: bash;">
[root@localhost ~]# erl -s hello
Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

hello world
[root@localhost ~]# cat hello.erl
</pre>
<pre class="brush: erlang;">
-module(hello).
-export([start/0]).

start()-&gt;
    io:format(&quot;hello world~n&quot;,[]).
</pre>
<pre class="brush: bash;">
[root@localhost ~]# erlc +debug_info hello.erl
[root@localhost ~]# erl
Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.3  (abort with ^G)
1&gt; rp(beam_lib:chunks(hello, [abstract_code])).
{ok,{hello,[{abstract_code,{raw_abstract_v1,[{attribute,1,
                                                        file,
                                                        {&quot;./hello.erl&quot;,1}},
                                             {attribute,1,module,hello},
                                             {attribute,2,export,[{start,0}]},
                                             {function,4,start,0,
                                                       [{clause,4,[],[],
                                                                [{call,5,
                                                                       {remote,5,{atom,5,io},{atom,5,format}},
                                                                       [{string,5,&quot;hello world~n&quot;},{nil,5}]}]}]},
                                             {eof,6}]}}]}}
ok
2&gt;
</pre>
<p>对着文档开始好好分析吧。 Have fun! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/76/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latest News from the Erlang/OTP team at Ericsson September 5 2009</title>
		<link>http://blog.yufeng.info/archives/77</link>
		<comments>http://blog.yufeng.info/archives/77#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:56:08 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[网络编程]]></category>

		<guid isPermaLink="false">http://mryufeng.javaeye.com/blog/479894</guid>
		<description><![CDATA[原文地址：http://erlang-factory.com/upload/presentations/167/KennethLundin-LatestnewsfromtheErlangOTPteamatEricssonErlang_Workshop2009.pdf Coming Open Source releases OTP R13B02 September 23 OTP R13B03 November 25 OTP R13B04 Jan-Feb 2010 OTP R13B05 ??? OTP R14B May-June 2010 OTP R14B01 OTP R14B02 Plans for later releases Multicore performance improvements – Delayed deallocation, let the right scheduler do it (R13B03) – Improved handling of process table – Separate allocators per [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：<a href="http://erlang-factory.com/upload/presentations/167/KennethLundin-LatestnewsfromtheErlangOTPteamatEricssonErlang_Workshop2009.pdf" target="_blank">http://erlang-factory.com/upload/presentations/167/KennethLundin-LatestnewsfromtheErlangOTPteamatEricssonErlang_Workshop2009.pdf</a></p>
<p>Coming Open Source releases</p>
<p>OTP R13B02 September 23</p>
<p>OTP R13B03 November 25</p>
<p>OTP R13B04 Jan-Feb 2010</p>
<p>OTP R13B05 ???</p>
<p>OTP R14B May-June 2010</p>
<p>OTP R14B01</p>
<p>OTP R14B02</p>
<p>Plans for later releases</p>
<p>Multicore performance improvements</p>
<p><span style="color: red;">– Delayed deallocation, let the right scheduler do it (R13B03)</p>
<p></span>– Improved handling of process table</p>
<p><span style="color: red;">– Separate allocators per scheduler</p>
<p></span>– Use NUMA info for grouping of schedulers</p>
<p><span style="color: red;">– Separate poll sets per scheduler (IO)</span></p>
<p>– Support Scheduler bindings, cpu_topology on Windows as well.</p>
<p>– Optimize Erlang applications in Erlang/OTP</p>
<p>– Fine grained parallelism, language and library functions.</p>
<p>– Better and more benchmarks</p>
<p>New way to build the documentation</p>
<p>– Using XSLTPROC to produce html, man and XSL-FO</p>
<p>– Using Apache FOP to produce PDF</p>
<p>Easier to interface C libraries and to make your own ”BIFs”</p>
<p>– Dynamically linked in BIF’s (for C-code , easier to write and more efficient</p>
<p>than drivers)</p>
<p>Support for validation in xmerl_sax_parser</p>
<p>BIFs for search in binaries (EEP-?)</p>
<p>红色的部分 好期待哦。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/77/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
