Jump to content
Sign in to follow this  
tudor.timi

Clarification on example 57

Recommended Posts

Here's example 57:

component top {
  resource R {}
  pool[4] R R_pool;
  bind R_pool *;

  action A { lock r R; }
  action B {}
  action C {}
  action D { lock r R;}

  action my_test {
    activity {
      schedule {
        {do A; do B;}
        {do C; do D;}
      }
    }
  }
}

The description states that the following execution orders are valid:

Quote

a) a, b followed by c, d.
b) c, d followed by a, b.
c) a, b in parallel with c, d.

If there were only one resource R, then a, b in parallel with c, d becomes illegal, due to the lock.

Would the execution of a, b and c in parallel and d also be legal? Theoretically, this could happen, since there is no locking going on. If it's not legal, from a PSS semantic point of view, is this because of the statement keeping scheduling dependencies within the sets? If so, an explicit note of this fact would be helpful. Also, what would be a compact way to add the behavior I described?

Share this post


Link to post
Share on other sites

From PSWG:

You are right. The execution of A, followed by B and C in parallel, followed by D, would be legal in this case. The explanation text is not clear enough. We filed a Mantis issue (#6343) proposing a fix to this. It will be fixed in the 1.0 version.

Share this post


Link to post
Share on other sites

Agreed that (a;b)&(c;d) may possibly be illegal because a and d use the same resource. But if a takes very less time to execute and c takes a long time, then a and d may not overlap their execution times, and so the conflict may not actually arise during simulation. So, my question is: is the legality check done statically (and pessimistically) or dynamically (ie during simulation time)?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...