This is the mail archive of the ecos-discuss@sourceware.org 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]

cyg_selwakeup and performance impact?


Hi,

One part of our application, the read thread cannot keep up with the
write for the serial driver when using pselect.  Since in the
serial.c, the cyg_selwakeup is used to tell the reader that is blocked
by a pselect when there is something available.  Sometimes, we found
that the thread will not get waken up when there are data to read.  A
workaround that we did is to comment out the condition in the function
serial_rcv_char() that wake up the thread in serial.c:
    //if( cbuf->nb == 0 )
        cyg_selwakeup( &cbuf->selinfo );

This change makes our application work as the reader will be waken up
more frequently from the pselect().  However, because cyg_selwakeup()
will __broadcast__ to all threads when this occurs.  This can be
expensive (sheduler lock/unlock, go through the queue and wake every
single thread).  Also, the serial.c is used as a kernel serial support
for our the customized serial drivers.  So changing here is probably
too pervasive.

I am wondering what other impact we may have after this change after
we tainted the eCos kernel.

Any comments and insights are much appreciated.

Zhichao


Zhichao Hong, CSDP
zhichao.hong@computer.org

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


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