mohitnegi Posted November 5, 2014 Report Share Posted November 5, 2014 Hello ,i have a scenario like this thread1 {while(1) e1.notify(); } thread2{ while(1){ wait(e1); } } know thread 1 leaves control after two loop i.e after two event notify now i want thread2 to also run twice ... can use sc_event_and_list here ???will this fullfill my purpose ... Quote Link to comment Share on other sites More sharing options...
David Black Posted November 5, 2014 Report Share Posted November 5, 2014 thread1 is an infinite loop because you failed to yield in the loop. Add: wait(1,SC_NS); or similar after the notify. You can use SC_ZERO_TIME if you like. Quote Link to comment Share on other sites More sharing options...
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.