[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] blocking thread



On Wed, 3 May 2000, Alain Rolle wrote:

> I have a thread that is not periodic, and to which I assign no schedule
> param (NULL passed inst. of 'attr'). In the thread there is a while loop
> continuously testing a volatile variable ( code : 'while(my_wait);' )
> Why does the whole system hang in this while loop, and not just this
> thread? This is definitely not my intention.

Because this is real time code - the highest priority, not preemtible.
You have to explicitely give control to operating system and then have the
system schedule it again.

What code is going to change my_wait variable?

I guess the right solution to your problem is using semaphores.

--
Tomek