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


Thanks Nick.  That fixed the problem!

In any case, I will look at switching to POSIX threads anyway.  Thanks for
all the help.

-- Dan


-----Original Message-----
From: Nick Garnett [mailto:nickg@ecoscentric.com]
Sent: Tuesday, November 26, 2002 10:19 AM
To: Dan Jakubiec
Cc: 'ecos-discuss@sources.redhat.com'
Subject: Re: New revision of select() hangs my code


Dan Jakubiec <dan@systech.com> writes:

> Okay, I tried Nick's test program and, of course, it worked fine on my
setup
> also.  So I did some more digging and have managed to home in on the
problem
> a little more.  I am not using POSIX threads in my app and I think this is
> causing a problem for the new select() code.  

That would be it. Generally it is not a good idea to mix the APIs,
making POSIX calls from non-POSIX threads can easily trip over exactly
the sort of problem you have found.

The addition of the pselect() functionality has now made the select
system use POSIX facilities if it is present.

> 
> In any case, what should this code do when not using POSIX threads?  As a
> side question, is it better to use POSIX threads or eCos threads in my
app?
> 

Generally if the POSIX package is installed, it is better to use POSIX
threads since things like the FILEIO package also configure to expect
it.

However, having said that, it is still useful to be able to call
FILEIO functions from non-POSIX threads occasionally. So, I've checked
in a patch to the POSIX package to hopefully make it possible.

Dan, please update from CVS and see whether it fixes your problems.


-- 
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/

-- 
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]