[En-Nut-Discussion] NutEventPost Handling

Harald Kipp harald.kipp at egnite.de
Tue Jul 20 16:41:06 CEST 2004


Matthias,

>>..
>>>f {
>>>         NutEventWait()
>>>         printf()...
>>>         NutEventPost()
>>>}
>>>
>>>T1: for (;;) f;
>>>T2: for (;;) f;
>>>
>>P.S. Your sample will switch the context, because sooner or later
>>printf() will put the thread to sleep. But I got your point.
>
>P.P.S: ... NO! :) surly printf will block, but as T1 didn't post
>(as it owns the mutex... :) T2 will start but immediately wait
>for the Queue to be signaled. when T1 wakes up again and call Post
>nothing happens. (do I miss something?)

Oops! You're right, one thread hangs around at
the semaphore until the other one returns from
possibly blocking output.

Harald




More information about the En-Nut-Discussion mailing list