You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The semantics of MPE_OP_TAIL_NOOP and MPE_OP_TAIL_NOOP don't follow their description,
nor the one of the similar tags on libhandler.
MPE_OP_TAIL_NOOP, ///< resume at most once without performing operations; and if resumed, it is the last action performed by the operation function.MPE_OP_TAIL, ///< resume at most once; and if resumed, it is the last action performed by the operation function.
The problem is that the implementation seems to assume that the resumption is always resumed,
even when the handler discards it and just returns. libhandler has a marker to indicate whether the
resumption was resumed or not. A similar approach could be taken.
I may be missing a correct way to discard a resumption instead of just discarding it.
A small test:
MPE_DEFINE_EFFECT1(sphinx, answer)
MPE_DEFINE_VOIDOP1(sphinx, answer, mpe_string_t)
void*brian(void*arg){
UNUSED(arg);
// Arrive at Thebessphinx_answer("Scooters");
// Diempt_assert(false, "Brian should have been eaten by the sphinx");
returnmpe_voidp_int(1);
}
/*----------------------------------------------------------------- Sphinx handler-----------------------------------------------------------------*/staticvoid*_sphinx_answer(mpe_resume_t*r, void*local, void*arg){
if (strcmp(mpe_mpe_string_t_voidp(arg), "Person") ==0) {
returnmpe_resume_tail(r, local, NULL);
} else {
// I couldn't find a way to release it, this one is not intended for MPE_RESUMPTION_INPLACE// mpe_resume_release(r);returnmpe_voidp_int(0);
}
}
staticconstmpe_handlerdef_tsphinx_hdef= { MPE_EFFECT(sphinx), NULL, {
{ MPE_OP_TAIL, MPE_OPTAG(sphinx, answer), &_sphinx_answer },
{ MPE_OP_NULL, mpe_op_null, NULL}
}};
staticvoid*sphinx_handle(mpe_actionfun_taction) {
returnmpe_handle(&sphinx_hdef, NULL, action, NULL);
}
The text was updated successfully, but these errors were encountered:
The semantics of
MPE_OP_TAIL_NOOP
andMPE_OP_TAIL_NOOP
don't follow their description,nor the one of the similar tags on
libhandler
.The problem is that the implementation seems to assume that the resumption is always resumed,
even when the handler discards it and just returns.
libhandler
has a marker to indicate whether theresumption was resumed or not. A similar approach could be taken.
I may be missing a correct way to discard a resumption instead of just discarding it.
A small test:
The text was updated successfully, but these errors were encountered: