mani bhatti wrote:
> Thanks Jan for your reply
> Actually the semaphore and mutexes stuff you have referred to i have
> already grounds for them.The only problem i have is please some body
> tell me that i dont want to make a thread periodic i,e i dont want to
> call a thread after periodic time interval i wanted it to  make it
> aperiodic like threads in C++ are scheduled by scheduler byitself

This has nothing to do with C++, rather with the class library you are
used to.

> and sleep on waiting condition with out any specific time interval
> and wake  only when  signalled from  pariodic thread. I hope you
> understand my point.Thanks a lot .

Let's try it differently:

thread_a()
{
        rt_task_set_periodic(...);
        while (1) {
                rt_task_wait_period(NULL);
                /* do some work */
                if (I_should_trigger_thread_b)
                        rt_sem_v(&sem);
        }
}

thread_b()
{
        while (1) {
                rt_sem_p(&sem, TM_INFINITE);
                /* so some other work */
        }
}

Again, read up what the services are exactly doing or you will be lost
once you have to modify things only slightly.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to