Jump to content

LT: temporal decoupling - sync

Recommended Posts



i have 3 temporal decoupled processes P1, P2, P3, two events e2 and e3, which respectively belong to the dynamic sensitivity of P2 and P3.


P1 / P2 performs the following actions

- execute a transaction

- e1.notify() / e2.notify()

- wait(sc_zero_time)


and P3 just generate a transactions


P3 is always the first to synchronize. Then P2 and finally P1 follows.


Is there a way to control the order in which this processes come back from synchronization? or Is there a way to ensure that the processes start running only after they are all back from synchronization??


because i have the following problem:

Sometimes (in some quantums) P1 executes his transaction and notifies e1 before P2 is back from synchronization and P2 missed the notification of e2, which in turn causes that P3 is not executed after it got back from synchronization because e3 is never notifies.


Thank you.

Link to comment
Share on other sites

It depends on the details of your model.

One possibility is to use e.notify(SC_ZERO_TIME) which will notify in the next delta. That may help.


However if your processes wait for more time (e.g. 1 ns) you may still miss the event.


By the way, when you say temporally-decoupled, do you mean you are using the quantum?




Link to comment
Share on other sites

Hello Alan,


1. i need to use the immediate notification not the delta one. i want all three processes to be executed in the same delta cycle as the notifications happened and so on in each delta cycle until the quantum is reached.


2. i don't understand. Could you explain please?


3. yes i am using the quantum.


Thank you

Link to comment
Share on other sites

By point 2) I meant if time advances in quantum steps, then any time delay less than the quantum cannot be seen, unless you explicitly wait for some event.


If you are using e.notify() you cannot guarantee the execution order - the scheduler is free to choose any process that is ready to run.


I don't really understand why you need to use immediate notify *and* the quantum, that sounds like an unusual model. The intention of the quantum is that all processes run ahead to the next quantum. If you explicitly call wait(SC_ZERO_TIME) many times, you will incur many context switches and so will not get as much benefit from the quantum.


But of course I don't know the detailed requirements of your model :-)



Link to comment
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.

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.

  • Create New...