[ECOS] RE: New revision of select() hangs my code

Dan Jakubiec dan@systech.com
Tue Nov 26 12:09:00 GMT 2002

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
> also.  So I did some more digging and have managed to home in on the
> 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

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 mailing list