Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

Process deadlock situation

$
0
0

Hi Guys

 

WIth the below program I was expecting the simulation will be blocked indefinitely but it exits and total simulation time is 0

 

Can someone tells me why it didn'y gets blocked indefinitely ?

 

#include "systemc.h"

SC_MODULE(event_trial){
    public:
    sc_event p1,p2;
    SC_CTOR(event_trial) {
        SC_THREAD(process1);
        SC_THREAD(process2);
    }

    void process1(){
        while(1){
            wait(p2);
            p1.notify();
        }
    }

    void process2(){
        while(1){
            wait(p1);
            p2.notify();
        }
    }
};

int sc_main(int , char**){
    event_trial et("et");
    sc_start();
    cout<<"Simulation time : "<<sc_time_stamp().value()<<endl;
 }


Viewing all articles
Browse latest Browse all 595

Trending Articles