[En-Nut-Discussion] Feature Request 1572837: mutex API nesting level info
Alain M.
alainm at pobox.com
Fri Jul 18 18:55:16 CEST 2008
IMHO this thear is shifting: it was originaly about controling IO
routines rentry which can ocur for long irq that reenable IRQ. I believe
that what I said is valid only for that context.
There is a point that draws my attention: Windows programers are used to
CRITICAL_SECTION used *as* a mutex, which is good for controling
threads. but NUT/OS's NutEnterCritical() is far from that and should not
be used as such...
Please correct me if I am wrong :)
Alain
Matthias Ringwald escreveu:
> On 14.07.2008, at 21:43, Alain M. wrote:
>> The "normal" way of controling re-entrancy is to have a mutex + a
>> counter, no standard simpler way. In Nut, NutEnterCritical() can be
>> lighter, but it may depend on the application.
>
> Hi. I hope you all know, that NutEnterCritical is ONLY for critical
> sections and...
> If you do any i/o, e.b. printf,.. there could be thread switch and the
> interrupts will be re-enabled.
> So only use it for a very short section and don't think it helps with
> other THREADS.
>
> If you do no I/O and don't call any NutEventWait... there will be no
> other thread by concept, hence
> no need for NutEnterCritical().
>
> Matthias
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
More information about the En-Nut-Discussion
mailing list