(1) Operation of tuples in Erlang:
1. Concepts of tuples:
1. Fixed Number
2. Any types that Erlang can recognize
2. Create a tuples:
1. f = {A, XX, 123, {345, BB, CC, "XX "}}.
3. Extract tuples
1. Matching:
Eg:
F = {A, XX, 123 },
{A, XX, YY} = f. % the value of YY is 123.
2. Erlang: element (Pos, mytuple). Pos indicates the first element, starting from
[Erlang crisis] (5.1.4) port, erlang5.1.4Original article, reproduced please indicate the source: Server non amateur research http://blog.csdn.net/erlib Sunface contact mailbox: cto@188.comPort
In a manner similar to processes, Ports shoshould be considered. ports are a datatype that encompasses all kinds of connections and sockets opened to the outside world: TCP sockets, UDP sockets, SCTP sockets, file descriptors, and so on.There is a general funct
For the installation of RABBITMQ, I also really wasted some effort, version download a lot, but there are compile problems, compile does not pass, error can not find the cause of errors, even error is * * * such existence.Other dependencies that I have not tested because I exist in the environment: Python,simplejson, installingBetween RABBITMQ is dependent on the Erlang language.Erlang installation is more important, version problems, compile problems
This article describes how to parse binary communication instances between php and erlang. For more information, see the following two common methods of network communication: text communication and binary communication. It is relatively simple to implement text communication between php and erlang. we will not discuss it here. this article mainly discusses how php and
This article describes how to parse binary communication instances between php and erlang. For more information, see the following two common methods of network communication: text communication and binary communication. It is relatively simple to implement text communication between php and erlang. we will not discuss it here. this article mainly discusses how php and
In Erlang shell, end an expression with a period plus a space, tab, or carriage return, and% represents the starting point of the comment; The module is the. erl file, the header file for the library. HRL, the shell's compile-time C (), outside the compile command when ERLC, exits the shell with Q (), or Erlang:halt ().The variable starts with an uppercase letter and cannot be re-bound, and can be assigned only once, with an immutable state.Atoms are
The main problem with map matching is to recall the map group map in Erlang, which is called hash hash or Dict dictionary in other languages.
Erlang supports mapping groups starting with the R17 version
Create a mapping group
The mapping group in Erlang is represented by a struct #{} that creates a mapping group that can be
Copy Code code as follows:
original articles, reproduced please specify the Source: Server non-amateur research http://blog.csdn.net/erlib author Sunface Contact e-mail: [Email protected]Initial Form File.erl1.preprocessing (pretreatment)Compile:file (file,[' P ']).2.expansion (Extended)Compile:file (file,[' E ']).3.core Erlang (Erlang core code)Compile:file (File,[to_core]).4.kernel Erlang
Went to Fuzhou, things did not fix, entrusted to the students to help deal with, home rest two days to work. Home these days the biggest harvest is the fourth time to reread the "deep Java Virtual Machine", previously unclear chapters enlightened, a sense of enlightened feeling, it seems, the technology of learning or anxious not to come.Gossip does not mention, continue the study of Erlang, last learned the chapter of distributed programming, the rem
Transferred from: http://www.thinksaas.cn/group/topic/244329/Feature Description: There is insufficient encoding support for various languages in Erlang, which uses Erlang to drive the well-known Iconv encoding library to encode and convert characters. File Description: Iconv_erl.c and iconv.h are the driver of the Erlang character encoding module, which is the f
Learning materials:
Official doc:http://www.erlang.org/doc.html
Written in special detail: http://www.cnblogs.com/zhengsyao/(strong push, write very detailed)
System Technology Research: http://blog.yufeng.info/
Zhongzhou Butterfly Erlang: http://www.blogjava.net/killme2008/category/20770.html
A blogger in the blog Park: http://www.cnblogs.com/lulu/category/559387.html
The other one: http://wqtn22.iteye.com
A simple e
1. Erl-detached
This document describes the applicability of daemons and background programs. It also applies when node is dynamically pulled in the Code. Otherwise, the problem of terminate Erlang will be reported.
2 init stop
Can terminate the VM, combined with RPC: Call can end the specified Node
3. control common test in code
CT: Install specifies the config file, CT: start_interactive (). This is very important. It specifies the interaction mode.
As mentioned above, the smerl in erlyweb already has a ruby-like tuples for programming. This article will introduce the basic principle of implementing tuples for programming. In smerl, the abstract form of Erlang is mainly used for implementation. We will examine the composition of Erlang abstract form in detail. The method is very simple. Refer to the abstract form section in the eralng document and use
Reprinted: http://mryufeng.iteye.com/blog/113856
ETS is Erlang term strorage meaning document see erl5.5.5/lib/stdlib-1.14.5/doc/html/index.html. This is a core function in beam. ETS, dets, and mnesia constitute the Erlang database. Note that mnesia has no storage mechanism.Its storage is ETS and dets.You can use ETS: I ().11 code set 254 11393 code_server12 code_names set 48 5323 code_server13 shell_recor
Summary: The features of Erlang are almost different from those of Erlang...
Variable immutable:
Guarantees atomicity and prepares for parallelism.
Tuples:
Similar to the structure in C language.
Person = {person, {name,joe}, {height,1.82}. }.
List:
[H | T]. The list starts with H and ends with T. The vertical line symbol (|) can separate the header and tail of the list, while [] is an empty li
A simple Erlang process pool Analysis
This is a simple Erlang process pool analysis, which islearn you some erlang for Great GoodHere is an example. For details, go to the official website!Main Flowchart
Implementation Principle
The implementation principles of this example are described in detail on the official website.ppool_servMedium,ppool_servIsgen_server be
-Cause
In the last group of services recently, the CPU usage of some node servers is very low, with only 1/4 of other servers. Eliminate service imbalance and suspected it was a system top statistics error. We found it through Erlang: Statistics (scheduler_wall_time) from the Utilization Survey of Erlang scheduler) check that the actual CPU usage of the machine scheduler with low server CPU is close to 100%
called fun prim_inet: Send/3, which is the function that gets stuck. Let's look at its source code:
1 send(S, Data, OptList) when is_port(S), is_list(OptList) -> 2 ?DBG_FORMAT("prim_inet:send(~p, ~p)~n", [S,Data]), 3 try erlang:port_command(S, Data, OptList) of 4 false -> % Port busy and nosuspend option passed 5 ?DBG_FORMAT("prim_inet:send() -> {error,busy}~n", []), 6 {error,busy}; 7 true -> 8 receive 9 {inet_reply,S,Status} ->10 ?DB
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.