P language used for asynchronous event-driven P Language

Microsoft recently open sourced P language, asynchronous event-driven programming dedicated to security in Linux, macOS and Windows.

Microsoft P described as a domain-specific language for communication between components modeling asynchronous systems, such as embedded, a network or distributed system. P is a program by a finite state machine (finite state machine) defined, these state machine run concurrently. Each state machine has an input queue state, conversion, storage local to the machine, and may transmit information to other asynchronous state machine. In basic operation of either P update the locally stored, sending a message, it is to create a new or state machine. The following code snippet shows how to describe a state of its P conversion. In addition, it demonstrates how to send a message or create a new state machine:

...
start state Init {
    entry {
        server = new Server();
        raise SUCCESS;
    } on SUCCESS goto SendPing;
state SendPing {
    entry {
        send server, PING, this;
        raise SUCCESS;
    }
    on SUCCESS goto WaitPong; } ...
 

Guess you like

Origin www.cnblogs.com/1994-jinnan411-top/p/11839444.html