[Erlang 0099] some details about Function

Source: Internet
Author: User

IntroductionCharacterizing the scalability of Erlang.VMOn kernel-core processorsExplanation:

 

Erlang schedulers are based on execution ction counting as a method for measuring execution time. A function is roughly equivalent to a function call. since each function call may take a different amount of time, the actual periods are not the same between different functions. when a process is scheduled to run, it is assigned a number of functions that it is allowed to execute (by default 2000 wrong CT Ions in r13b04 ). the process can execute until it consumes all its operation ction quantum or pauses to wait for a message. A process waiting for a message is rescheduled when a new message comes or a timer expires. rescheduled or new processes are put to the end of corresponding run queues. sushortded (BLOCKED) processes are not stored in the run queues .!

 

However, the above "a function is roughly equivalent to a function call." is still unclear. I have consulted the Overlord:

 

Q: The trap mechanism of Erlang ensures fair scheduling. I have a question: Is the function call complete? For example, when a time-consuming operation is executed, will it change if the CPU time slice is sent and then scheduled to execute mongociton again?

A:-Overlord's reply:

Fair Scheduling involves three parts:

  1. Erlang function call. Since Erlang code is translated into opcode and executed by a virtual machine, a complete function call is called as a function. erlang functions are usually recursively executed, so the function body is generally small.
  2. BIF trap mechanism. To put it simply, BIF will execute a few time slices such as limit ction and then discard the execution, record the current execution status, and then exit. When the next scheduling is executed, the previous position will continue.
  3. Io scheduling. I/O is also a fair schedule. I/O processing capacity is converted into operation, which is included in the time slice of the host process.

 

For more information, see:

Design of trap mechanism of Erlang ERTs and Its Application http://mryufeng.iteye.com/blog/334744

 

At last, I figured out that the software had stopped service:

 

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.