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: New revision of select() hangs my code


--- Begin Message ---
Dan Jakubiec <dan@systech.com> writes:

> I just grabbed the latest version of
> ecos/packages/io/fileio/current/src/select.cxx (I went from rev 1.8 to 1.9).
> The changes in this file break my current code which uses the select() call.
> I looked through the code changes, but didn't see anything obviously wrong.
> 
> Nick Garnett:  Would you mind having a look at this to see if you can see
> something?
> 

I cannot see anything wrong with your code. I even built it into a
test program and ran it, it seems to do the right thing -- I cannot
reproduce the problem. I've attached my test program for you to try
out. I ran it on a PC using the standard net template, and got the
following output:

Main: calling pthread_join(thread1)
Thread2: calling sleep(5)
Thread1: calling socket()
Thread1: calling bind()
Thread1: calling listen()
Thread1: calling accept()
Thread2: calling socket()
Thread2: calling connect()
Thread2: writing data to stream
Thread1: calling sleep(5)
got data
got data
got data
Finished flushing data

If I set the #if in pthread_entry2() to zero, I get the same, without
the "got data" lines.

You don't say what configuration you are using, maybe there is
something in that which is upsetting things. Try the standard net
template, and check that your CVS checkout is up to date. Also check
that you are not getting stack overflows -- it may be that select() is
using a little more stack than it used to.


Attachment: sel.c
Description: Select test

-- 
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/
--- End Message ---
-- 
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]