[ECOS] Re: New revision of select() hangs my code
Tue Nov 26 10:19:00 GMT 2002
Dan Jakubiec <firstname.lastname@example.org> 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
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
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss