Skynet Source Analysis 1: Opening Ming Yi

Source: Internet
Author: User
Tags ming

Skynet is a server framework based on the actor model implemented by the cloud wind, with core 7,000 + lines of C code and a LUA binding. Write more concise, use more readily, very close to my appetite, combined with the decision in the company's recent project on the Skynet, so decided to read through the source code, will think of the results recorded in this, so that the use of conscience.

The implementation of Skynet is based on several actor behaviors:

    • Can create and destroy other actor,actor as a lateral relationship.
    • can send messages to other actors and receive messages from other actors.
    • Interaction between actors can only be passed through the message.
    • Able to handle their own messages.

In the Skynet world, the actor is represented by a dynamic library, and each so is given an ID that never repeats ([1,4g]) as the identity, so must register a callback function with the framework to process the message. The framework does only two things:

    1. The message sent is correctly delivered to the target actor.
    2. A balanced, fast call to So's callback handles the message, which is not concurrent and only processes one message at a time.

Not to be continued, there are inappropriate, please friends to correct me.

Skynet Source Analysis 1: Opening Ming Yi

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.