This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cyg_mbox_get blocks off other threads?


>>>>> "Stijn" == Stijn Symons <stijn.symons@acunia.com> writes:

    Stijn> We have a thread running at a high priority wich is waiting
    Stijn> eternally on a message out of queue with cyg_mbox_get. This
    Stijn> thread is waiting for messages of other threads to say they
    Stijn> want to die. These dying threads run at a lower priority.

    Stijn> It seems that our waiting thread is blocking off all the
    Stijn> other threads. Doesn't the waiting thread let other threads
    Stijn> play while it's doing cyg_mbox_get? Or is this the 'highest
    Stijn> priority runs' trick in full effect?

cyg_mbox_get() is a blocking operation, not a polling operation. If
the mailbox is empty then your high-priority thread will be blocked
and other threads should get a chance to run. I suspect there is
something else going wrong inside your application.

IIRC cyg_mbox_get() ends up inside a template expansion in the
kernel's include/mboxt.inl file, look for

template <class T, cyg_count32 QUEUE_SIZE>
CYG_MBOXT_INLINE cyg_bool
Cyg_Mboxt<T,QUEUE_SIZE>::get( T &ritem )
{
    ...
}

so if you want to put in some diagnostics to help figure out what is
going on, that might be a place to start. Unfortunately the
implementation of mailboxes uses C++ templates, which makes it a bit
more difficult to use gdb breakpoints and the like.

Bart

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]