1 Reply Latest reply on Aug 18, 2015 5:28 PM by JPMontero_Intel

    pthread instead of Signal in yocto linux

    parth9966

      hi,

       

       

        struct itimerval tmr,ptmr;

        tmr.it_value.tv_sec = 0;

        tmr.it_value.tv_usec = 2;

        tmr.it_interval = tmr.it_value;

       

       

        ptmr.it_value.tv_sec = 0.5;

        ptmr.it_value.tv_usec = 0;

        ptmr.it_interval = ptmr.it_value;

       

       

        signal((int)SIGALRM, signal_handler);

        signal((int)SIGVTALRM, print_heartrate);

        setitimer(ITIMER_REAL, &tmr, NULL);

        setitimer(ITIMER_VIRTUAL, &ptmr, NULL);

       

       

      now here, signal with timer,  call these two method 1. signal_handler and 2. print_heartrate

       

      now how can I done same thing with pthread...I want to call Signal_handler method in every 2ms or micro sec.


      this signal,  interrupt my other thread.