[P4] Fwd: Re: [P4-discuss] Question regarding semantics of actions in P4-14 (v1.0.3)
Sándor Laki
lakis at elte.hu
Thu Jan 19 11:22:24 CET 2017
-------- Forwarded Message --------
Subject: Re: [P4-discuss] Question regarding semantics of actions in
P4-14 (v1.0.3)
Date: Thu, 19 Jan 2017 02:15:10 -0800
From: Nate Foster <jnfoster at cs.cornell.edu>
To: Ali Kheradmand <a.i.kheradmand at gmail.com>, Nikolaj Bjorner
<nbjorner at microsoft.com>
CC: Grigore Rosu <grigore.rosu at gmail.com>, p4-discuss at lists.p4.org
Hi Ali,
It's almost like one needs to formalize the semantics to make sense of
this! ;-)
I wasn't involved with drafting the P4-14 spec so I could be wrong, but
based on the informal text, I believe the intention is that the order of
the statements is ignored, but the primitive instructions are executed
with something akin to "true concurrency" and what Lamport calls
"regular" in his classic work on semantics of registers. That is, after
executing a the field h.a would either have the value 1 or 2, but not
some other value (which weaker notions like "safe registers" allow, due
to hazards that may occur when shared memory is written by two different
threads simultaneously).
The way I would model this in an operational semantics is to (i) copy
the old state before evaluating the primitives in the action body and
(ii) define a merge operation that takes the updated states produced by
evaluating the primitives and (non-deterministically) merges them to get
a new state.
Maybe Nikolaj can weigh in on how P4-NoD handled this issue?
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/09/p4nod.pdf
Cheers,
-N
On Wed, Jan 18, 2017 at 11:59 AM, Ali Kheradmand
<a.i.kheradmand at gmail.com <mailto:a.i.kheradmand at gmail.com>> wrote:
Hi,
In the language specification version 1.0.3, section 9.2.1 it is
stated that “P4 assumes parallel semantics for the application of
all the primitive actions executing as a result of a match in a
given table.” It also mentions that “With parallel semantics, […]
actions are started at the same time”.
I was wondering whether it means that the order of actions are not
important at all or not. If the order is ignored, I what happens if
two primitive actions that are executed as a result of a match have
overlapping effects, for example:
action a ( ) {
modify_field(h.a, 1);
modify_field(h.a, 2);
}
If the order is important, how exactly it relates to the parallel
semantics?
Regards,
Ali
---
Ezt az e-mailt az Avast víruskereső szoftver átvizsgálta.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://plc.inf.elte.hu/pipermail/p4/attachments/20170119/bbdb0578/attachment.html>
-------------- next part --------------
_______________________________________________
P4-discuss mailing list
P4-discuss at lists.p4.org
http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org
More information about the P4
mailing list