ankushKumar Posted November 25, 2014 Report Posted November 25, 2014 SC_THREAD(A) SC_THREAD( B ) SC_THREAD( C ) A(){ while(1){ wait(e_A); e_B.notify(SC_ZERO_TIME); e_C.notify(SC_ZERO_TIME); ------- } } B(){ while(1){ wait(e_B ); ------- ------- } } C(){ while(1){ wait(e_C); ------- ------- } } In the above case acc. to systemc scheduler the threads will be notified in delta phase. Now my question is, whether its a nodeterminstic condition which of the thread will run 1st b or c , or is it like that the one notified 1st will get the control 1st. Quote
ralph.goergen Posted November 25, 2014 Report Posted November 25, 2014 Hi, Now my question is, whether its a nodeterminstic condition which of the thread will run 1st b or c , or is it like that the one notified 1st will get the control 1st. Actually neither nor. The order of execution of threads in one delta cycle is not defined. First, execution order does not depend on the notification order. Changing the order of notification will not change the thread execution order. Second, the execution order is not fully nondeterministic. If you do not change the model (and the simulator), the order will allways be the same. This depends on the thread lists in the simulation kernel and the order of thread instantiation. BUT YOU SHOULD NOT RELY ON THIS ORDER since different simulators may use different orders. Greetings Ralph maehne and David Black 2 Quote
ankushKumar Posted November 25, 2014 Author Report Posted November 25, 2014 First, execution order does not depend on the notification order. Changing the order of notification will not change the thread execution order. Greetings Ralph Hiii Raplh Is it like that the execution order and notification order is independent of simulation kernel Quote
Recommended Posts
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.