AW: [En-Nut-Discussion] Again a thread question

Pavel Chromy chromy at
Wed Jun 9 15:00:18 CEST 2004

Ole Reinhardt wrote:

>>higher priority thread running more often without
>>completely blocking the lower priority thread?
> Right. The lower priority thread does something (output on lcd) and the
> waits for one second. 

I'm still not getting why you need/want the lcd thread be running with lower priority, while you do the scheduling yourself (waiting one second)? I see no reason for that. 

> The Main thread shall do something with higher
> priority later... but should not block completly the display thread. On
> the other hand I would not like to wait always for at lease 64 ms (to
> not freeze the system like it is described in the documentation).

Use the same priority. In most of the situations there is no reason to fiddle around with the priorities.
In cooperative multithreading thread priority has no effect when the thread is running, because the thread cannot be preemted anyway. It is taken into account only upon context switching, this is nature of cooperative multithreading, so the wait operations (be it either sleep or waiting for data from a device) are the ones who determine the ratio of cpu utilization among the threads.

> Btw: Any suggestions for my killing problem?

Use the same priority.

#define QUESTION ((bb)||!(bb))

Mgr. Pavel Chromy
ASIX s.r.o.
Staropramenna 4
150 00 Praha 5

More information about the En-Nut-Discussion mailing list