2008-06-16

ASN.1协议 适合我们用吗?

关键字: asn.1 encode decode
R12B发布以后 号称ASN.1解码速度快了好多。前天仔细看了文档,感觉用在自有的系统去不错。ASN.1的结构还是很紧凑的,BER,PER,BER_BIN,PER_BIN都支持。特别是支持选择性decode,这个feature非常赶兴趣。用在自己的项目里面就省去了很多协议编解码的繁琐和易错,毕竟asn compiler也做了几万行 我相信他的性能。
2008-06-13

gen_tcp 应对对端半关闭

关键字: gen_tcp shutdown exit_on_close
当tcp对端调用shutdown(RD/WR) 时候, 宿主进程默认将收到{tcp_closed, Socket}消息, 如果这个行为不是你想要的,那么请看: shutdown(Socket, How) -> ok | {error, Reason} Types: Socket = socket() How = read | write | read_write Reason = posix() Immediately close a socket in one or two directions. How == write means closing the socket for ...
2008-06-12

Erlang/OTP R12B-3 released

关键字: erlang/otp r12b-3 released
Erlang/OTP R12B-3 released The third service release for Erlang/OTP R12B has been released. (June 11, 2008) 最大的卖点: An experimental module "re" is added to the emulator which interfaces a publicly available regular expression library for Perl-like regular expressions (PCRE). The interface is pur ...
2008-05-22

看例子写 testserver 和commontest 测试案例

关键字: testserver commontest
R12发步的时候 附带了testserver和commontest,有文档但是没有详细的叫你如何写测试案例。今天发现官网上有早期的测试案例(R9)的,可以参考下: http://www.erlang.org/project/test_server/index.html 有3种测试案例: test_server-3.1.1.tar.gz The test server application. emulator-tests-2004-05-26.tar.gz Test suites for the emulator. stdlib-tests-2004-05-26.tar.gz T ...
erlang的list 和 string 库实现 有我们自己实现函数的时候可以模仿的很多手法, 看熟悉了 容易在头脑里面自然反射代码的实现,俺学c的时候就是学会了字符串操作的时候感觉功力大增。
2008-04-12

erlang如何写port驱动与外面世界通讯

关键字: pg2 port supervision
鉴于很多同学在帖子里面询问erlang与外面世界交互的port如何写的问题, david king很早前就写了篇文章详细地解决了这个问题,而且很有深度。请参见http://www.ketralnis.com/roller/dking/entry/20070903 Supervision Trees and Ports in Erlang 08:31PM Sep 03, 2007 in category Erlang by David King Erlang provides a whole lot of infrastructure for doing tasks commonly as ...
Bug fix release : otp_src_R12B-2 Build date : 2008-04-09 This is bug fix release 2 for the R12B release. 看看什么变化。
2008-03-05

file:read_file的注意细节

关键字: file:read_file file:open file:read
arbow发现的问题如下: 4> file:read_file("/proc/cpuinfo"). {ok,<<>>} 11> {ok, IoDevice} = file:open("/proc/cpuinfo", [binary]),file:read(IoDevice, 1024). {ok,<<"processor\t: 0\nvendor_id\t: GenuineIntel\ncpu family\t: 6\nmodel\t\t: 15\nmodel name\t: Intel(R) Core(TM)2 CPU "...>>} 同样的虚拟文 ...
引用地址 http://firewallproxy.org/index.php?q=uggc%3A%2F%2Fccbyi.jbeqcerff.pbz%2F2008%2F02%2F25%2Fcnefvat-pfi-va-reynat%2F So I need to parse a CSV file in erlang. Although files in CSV have a very simple structure, simply calling lists:tokens(Line,",") for each line in the file won't do the trick, as ...
在erlang的邮件列表上看到: Have you tried putting a snoop to see whether the delay is on the sending/receiving side? This might be useful: http://www.erlang.org/contrib/erlsnoop-1.0.tgz 去http://www.erlang.org/contrib/看了下 模块真不少 下载了erl_snoop 先安装lib-pcap yum install libpcap-devel yum install libpcap 编译出错 ...
release 说明: http://www.erlang.org/download/otp_src_R12B-1.readme 对比了下代码看来r12b1主要是在smp情况下改进了内存分配的速度(内存浪费更多 典型空间换时间) 还有就是lksctp的支持。 binary的也做了少许的优化。其他的大多数是bugfix。
之前erlang邮件列表的一个问题: hi list, I fellowed the otp document, but it failed. # erl -s os cmd ls Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] [kernel-poll:false] [lock-checking] {"init terminating in do_boot",{function_clause,[{os,validate1,[[ls]]},{os,cmd,1},{init,start_it, ...
2008-01-22

dets ram_file模式和 dets + ets的选择

关键字: dets ram_file
从mod_security_server.erl 中摘抄的: %% %% The storage model is a write-through model with both an ets and a dets %% table. Writes are done to both the ets and then the dets table, but reads %% are only done from the ets table. %% %% This approach also enables parallelism when using dets by returning t ...
2008-01-21

arbow发起 erlycachedb 项目

关键字: erlycachedb
An memcachedb clone by Erlang 支持cache的分布和持久化。 http://code.google.com/p/erlycachedb/ 年前解决issue 1,2 的问题。
2008-01-18

R12B0的文档细致了很多

关键字: 文档 patch
新文档重点的部分都用色彩重点标出 而且告诉你什么函数声明模块要废弃 要注意什么事项 真的很细致哦。赞个。另外R12B0的patch也出来了,在download页面里面有readme.
R12B0的文档里面写着: 6.6 Function Calls ExprF(Expr1,...,ExprN) ExprM:ExprF(Expr1,...,ExprN) ExprM should evaluate to a module name and ExprF to a function name or a fun. When including the module name, the function is said to be called by using the fully qualified function name. This is often refe ...
2007-11-19

erlang r12 新增加Percept并发性能调测模块

关键字: Percept profile 并发
Percept is an application-level profiler with focus on parallelism. Can help in finding:     – synchronization bottlenecks     – periods of few runnable processes Makes use of new trace points in the virtual machine. Collects data about when pro ...
注:Joel Reymont openpoker游戏的作者 都是非常高级的话题 涉及到实际项目的设计  编码  调试 部署 维护等话题  覆盖到大部分的otp应用 我们拭目以待。 Working title is Hardcore Erlang and it will be built around OpenPoker. The emphasis of the book will be more on showing how to write scalable Erlang servers and less on how to write a poke ...
2007-11-01

why-do-you-like-erlang(转)

关键字: network server thread core
原文Url: http://www.clickcaster.com/items/why-do-you-like-erlang 感觉写的非常好(激动中) 和我的经历几乎一样  得出的结论就是: erlang就是我要的 网络应用erlang足够强大了 After having turned into something of an Erlang zealot about two months ago, I've been asked this question quite frequently. I think the best way to explain this is ...
2007-10-27

erlang R12B预览版本出来了

关键字: R12B release
erlang R12B预览版本出来了 可以在 http://erlang.org/download/snapshots/otp_src_R12B-0.tar.gz  下载, 正在比对 看作了什么改进。
2007-10-25

erlang 模拟器工作原理分析

关键字: emulator implement erts
这个是erlang聚会的时候作的一个ppt 简单介绍了emulator的组成和运作原理,凑合着看把,详细的等时间沉淀再写。
2007-10-25

erlang的erl_crash.dump产生以及如何解读

关键字: erl_crash core dump
正常情况下 当erlang进程发生错误没有catch的时候 emulator就会自动产生erl_crash.dump,来提供crash的时候的emulator最详细的情况,类似于unix的core dump. 其中下边几个env变量控制dump产生的行为: ERL_CRASH_DUMP If the emulator needs to write a crash dump, the value of this variable will be the file name of the crash dump file. If the vari ...
2007-10-24

Erlang heart 高可靠性的最后防线

关键字: heart watchdog
heart由2部份组成: 1. 外部程序 heart  2. erlang  port模块 heart.erl。 当开启heart的时候(erl - heart ...) 外部程序heart被erlang模块heart.erl 启动起来,监视emulator的运作. heart.erl 每隔一定的时间向heart外部程序报告状态。当外部heart没有监测到心跳的时候就要采取行动 重新运行$HEART_COMMAND所指定的命令。 heart机制有2个用处: 1. erlang虽然内置了很多supervisor 可以保证process的高可靠性 但是假 ...
2007-10-23

erlang driver和热部署(重要)

关键字: driver erl_ddll 热部署 release_handling
erlang的热部署包括2个方便的 beam(.beam)级别的和driver(.dll .so)级别的. beam级别的就简单。但是driver级别的就相对复杂很多。 先看下erl_ddll的说明: Loading and reloading for code replacement This scenario occurs when the driver code might need replacement during operation of the Erlang emulator. Implementi ...
2007-10-23

erlang inet_ssl_dist有BUG 导致节点通讯不能用SSL

关键字: inet_ssl_dist ssl node message
Erlang R115B 的inet_ssl_dist模块有bug, 我已经定位到问题 提交到 bug mailist,  erlang社区的人已经修了这个BUG,并且提交了patch.  有了SSL 通讯更安全些。 具体请参看: http://avindev.javaeye.com/blog/103310
2007-10-22

erlang sctp支持

关键字: erlang sctp
erlang kernel 带了个gen_sctp  实现了sctp的 client和server操作, 在linux 2.6 上协议栈支持 lksctp。 网络如果有双线 那么sctp就非常有用 可以起到网络冗余的作用。遗憾的是, R11B5 没有inet_sctp_dist模块 否则erlang的rpc也能走sctp, 那多美呀! sctp可以参考ibm linux china上的文章。
2007-10-20

erlang远程控制

关键字: erlang slave pool ssh rsh connect boot loader
1. MODULE slave MODULE SUMMARY Functions to Starting and Controlling Slave Nodes 2. MODULE pool MODULE SUMMARY Load Distribution Facility 3.  Erlang Shell Eshell V5.5.5  (abort with ^G) 1> User switch command  --> h   c [nn]   - connect t ...
2007-10-18

开始规模研究global 和 global_group global_search的原理

关键字: global global_group global_search erlang dist
The ability to globally register names is a central concept in the programming of distributed Erlang systems. 分布式系统 包括流行的p2p系统 要实现的好 必须解决的一个问题是 global名称的问题。 erlang实现的很复杂  erl代码实现了好几千行 折合c语言是好几w行  所以这个是erlang和其他系统竞争的强大优势。 但是实现原理上erlang没有提供相应的设计文档 而且google上也找不出任何有价值的材料  只能自己从代码分析 ...
2007-10-17

查看erlang内存使用情况

关键字: erlang info
io:format("~s~n", [binary_to_list(erlang:info(info))]). 得到结果 =memory total: 219521173 processes: 718806 processes_used: 713510 system: 218802367 atom: 347085 atom_used: 338851 binary: 13159 code: 2951013 ets: 182152 =hash_table:atom_tab size: 6421 used: 4522 objs: 7848 de ...
2007-10-17

erlang热部署

关键字: erlang hot deploy release handling
erlang的热部署, 相当吸引人,它的release handling 作的非常细, 有核心模块支持(emulator实现), 有工具支持,  支持远程部署, 非常适合工业级别的应用。 文档很详细, 感觉应用起来前途很光明。 有空专门写个文章分析下原理。
mryufeng
搜索本博客
最近加入圈子
存档
最新评论