Jump to content
Tanja

LT: temporal decoupling - sync

Recommended Posts

Hello,

 

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.

Share this post


Link to post
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?

 

regards

Alan

Share this post


Link to post
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

Share this post


Link to post
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 :-)

 

Alan

Share this post


Link to post
Share on other sites

Hello Alan,

 

i'am using e2.notifiy() and there is only process P2 sensitive to that event ( dynamic sensitivity), but sometimes it misses that notification. Is it possible?

 

Regards

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×