- 浏览: 982369 次
- 性别:
- 来自: 广州
最新评论
-
qingchuwudi:
有用,非常感谢!
erlang进程的优先级 -
zfjdiamond:
你好 这条命令 在那里输入??
你们有yum 我有LuaRocks -
simsunny22:
这个是在linux下运行的吧,在window下怎么运行escr ...
escript的高级特性 -
mozhenghua:
http://www.erlang.org/doc/apps/ ...
mnesia 分布协调的几个细节 -
fxltsbl:
A new record of 108000 HTTP req ...
Haproxy 1.4-dev2: barrier of 100k HTTP req/s crossed
文章列表
一直对erlang的group_leader这个概念很困惑,因为*nix系统也有类似的名词但是只是和进程组管理有关系。查了很多文档才知道,erlang的group_leader的设计意图和作用,解释如下:
先看下着段代码运作:
log_group_leader(OGL) ->
receiv ...
1. The eunit application (for unit testing of Erlang modules) by Richard Carlsson is now included in OTP.
2. There is now experimental support for loading of code from archive files. See the documentation of code, init,erl_prim_loader and escript for more info.
3. public_key first version.
还是R12的bug ...
> I only have 3Gb of memory in my accelerator at Joyent and I'm trying
> to launch 10 nodes. beam starts with RSS of about 135Mb and quickly
> goes to 500Mb+.
>
> How can I minimize the footprint of my running nodes?
>
> I'm starting slaves like this:
>
> common_args() -> ...
CN Erlounge III - 发起
1. 时间:2008-12-20 ~ 2008-12-21,为期2天
2. 地点:上海(详细地址待确定)
3. 人物:面向 Erlang 中国社区,但不排斥其他任何对 Erlang、分布式、多核等话题感兴趣的人。
4. 议题: Erlang 语言相关技术、Erlang 应用、Erlang 与其他语言协作、分布式、多核等等。
5. 会议主持:ECUG 会务组
会议形式
1. 多数时间由交流会讲师针对某个 Topic 进行论述,其他人提问(Q&A)方式交流。
2. 留出一小段时间,安排沙龙式的对等交流机 ...
闲来的时候做了个tail 程序,和*nix下的tail功能一样
Usage: ./tail -n nnnn filename
lua版本代码 20行, c版本代码173行,开发速度大概差5倍。
代码效率:
time tail -n 1000000 /var/log/haproxy.log >/dev/null 从log文件尾巴中抽取1000000行。
1.linux 版本的tail:
real 0m0.330s
user 0m0.172s
sys 0m0.156s
2. c版本的tail:
real 0m0.398s
user 0m0.156s
s ...
Erlang Source via Git 2008-08-01
From the erlang-questions mailing list:
“I find Matthew Foemmel’s http://github.com/mfoemmel/erlang-otp/tree git repository to be very handy for browsing the OTP source, working out when features were added (the history goes back to R6B-0) and so on. Erlang/ ...
- 2008-08-04 14:38
- 浏览 5200
- 评论(2)
我们在编写lua模块的时候经常会遇到申请内存的情况,有2中用途 1。 临时的 2. 长期的。 通常我们是用malloc来分配内存 free来释放。但是这样做的话 lua runtime就没有办法跟踪内存的使用。但是我们有解决方法:
1. 临时的 通过LuaL_Buffer来, 因为LuaL_buffer有自主扩展能力,所以我们可以存入很多数据 只是每次可以直接使用buffer的大小有限制。
2. 长期的, 通过lua_newuserdata 放在fenv里面. fenv 是个table,而且可以gc. 当分配的内存不够用的时候 可以重新分配一个 然后lua_replace一下 这样旧的内存就会被 ...
July 20th, 2008 : two lines...
Two lines... That's all what is needed with the new TCP content inspection system to stop half of the spams I got home. One of my major customers who uses HAProxy a lot has sponsored the development of some preliminary content inspection which is used to decide w ...
- 2008-07-25 12:23
- 浏览 5109
- 评论(0)
参见: http://lua-users.org/wiki/FrontierPattern
Frontier Pattern
lua-users home
wiki
The "frontier" expression pattern %f is undocumented in the standard Lua references (for reasons why see LuaList:2006-12/msg00536.html).
I would like to present here the usefulness of it, in an attempt ...
- 2008-07-23 17:57
- 浏览 5093
- 评论(0)
lua垃圾收集的原理 参见: http://lua-users.org/wiki/EmergencyGarbageCollector
Notes about how the Lua garbage collector works
Disclaimer: This is the first time I have worked on a garbage collector so some of this may be incorrect. Corrections/cleanups are welcome. --RobertGabrielJakabosky
"While working ...
- 2008-07-22 00:46
- 浏览 4586
- 评论(0)
Yueliang: http://yueliang.luaforge.net/
Introduction
The goal of Yueliang is to implement Lua 5 in Lua 5. Such a codebase, if well documented, can be a useful prototyping and educational tool. Initially, the focus is on the front end of Lua, i.e. the lexical analyzer, the parser and the code genera ...
当要用c实现lua的模块的时候 就涉及到模块的编译 调试 运行 而这些步骤很繁琐,容易出错,有了luatcc就可以直接在lua代码里面直接写c代码了 动态运行 岂不是很cool, 大大提高了开发速度。
luatcc项目网站: http://luaforge.net/projects/lua-tcc/
require "lua_tcc"
m = tcc.compile ([[
#include "lua.h"
typedef struct {
void *s;
} tc ...
Coco is a small extension to get True C Coroutine semantics for Lua 5.1.
Coco is both available as a stand-alone release and integrated into LuaJIT.
The stand-alone release is a patchset against the standard Lua 5.1.3 distribution. There are no dependencies on LuaJIT. However LuaJIT depends on Coco ...
- 2008-07-04 16:41
- 浏览 6114
- 评论(0)
copas是纯lua的实现 依赖于luasocket, 但是毕竟大的现在,只能支持1024个并发,是select机制的限制。
luaevent和copas的接口很像,基于libevent,支持epoll等,可以支持大规模的并发。
copas经过几天几夜的测试, 比较稳定,但是吃比较多的内存。
luaevent测试在进行中。
注:
在copas或者luaevent.loop 中加入
print(collectgarbage("count")) 可以知道lua vm用的内存 以K为单位。
- 2008-07-04 15:37
- 浏览 6338
- 评论(0)
Ascii85 (also called "Base85") is a form of binary-to-text encoding developed by Paul E. Rutter for the btoa utility. By using five ASCII characters to represent four bytes of binary data (encoded size 25% larger), it is more efficient than uuencode or Base64, which use four characters to r ...