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: Wake select() with a signal


On Mittwoch, 6. November 2002 18:13, Nick Garnett wrote:
> In Unix I suppose one way of fixing this would have been to add a pipe
> to the set of read FDs and have the other thread write to that to wake
> the select() -- you probably don't need to use a signal at all. We do
> not have pipes in eCos, but a loop-back TCP socket would probably do
> the same thing.
>
> The POSIX-200X standard has added a pselect() call, which takes an
> additional signal mask argument, specifically to allow this race
> condition to be eliminated.

You are right, this will be a general problem for me. Till now I never had the 
race condition if the signal comes just before calling select(), but I think 
this is only, because my application waits most of the time in the select().
To be sure that my application work always, I have to use one of the solutions 
you have written.

I'm thinking of implementing a pselect() call. Where should this function be 
located, in packages/compat/posix or in packages/io/fileio?

Roland


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