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]

Re: How to use cyg_io_select


Franck MAMALET FT-R&D DIH/OCF wrote:
> 
> Hi,
> I would like to use a non-blocking serial read with wake-up capabilities.
> 
> I have selected  CYGPKG_IO_SERIAL_SELECT_SUPPORT in my configuration.
> 
> The function cyg_selrecord() (called by serial_select called by
> cyg_io_select) stores the thread number in a "sip" structure.
> And serial_rcv_char calls cyg_selwakeup  tests the sip structure when rx
> buffer going from empty to non-empty. However this function broadcast a
> CYG_COND_VARIABLE called selwait.
> I guess I don't use these functions in the right way, because my thread
> is never linked to selwait and will never be woken-up.
> 
> Can anyone explain to me how it should work? and how to use it?

I'm not entirely clear on your problem but anyway. For the thread to wake
up, it must have been blocked waiting in select(). That means having opened
and used the serial devices using open/read/write, and not cyg_io.
cyg_io_select() is the select file operation, it isn't actually an
equivalent of select(). 

But since you say you want a non-blocking read, I don't know quite why
there would be anything that needed waking up!

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/


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