This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: select () confusion
- To: "'Jonathan Larmour'" <jlarmour at redhat dot com>
- Subject: RE: [ECOS] select () confusion
- From: "Trenton D. Adams" <tadams at extremeeng dot com>
- Date: Thu, 2 Aug 2001 16:30:39 -0600
- Cc: "'eCos Discussion'" <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Extreme Engineering
>
> Yeah, that's because the reason it was there originally was for
> efficiency,
> and we know that's not relevant for Windows ;).
>
LMAO, I agree. But, doesn't that assume that the programmer actually
knows how to program efficiently? I mean wouldn't it be more efficient
for someone that knows what efficient is to do this internally?
> > Since FD_SET always
> > increments the fd count anyhow, I don't see a point in even using
the
> > first parameter.
>
> Eh? FD_SET doesn't change the value of the highest fd you will be
> selecting
> on, or the number of fds you have. It just sets a bit in a bitmask
(the
> fdset).
>
Oh, I was referring to the windows docs. I guess they are completely
different. I can definitely see why that would be efficient now. After
all, an fd_set in eCos is only an array of integer masks. Bit
manipulation is much faster than going through an array of SOCKETs.
eCos fd_set
typedef struct fd_set {
fd_mask fds_bits[__howmany(FD_SETSIZE, __NFDBITS)];
} fd_set;
windows fd_set (LMAO, they suck)
typedef struct fd_set {
u_int fd_count; // how many are SET?
SOCKET fd_array[FD_SETSIZE]; // an array of SOCKETs
} fd_set;
And, infact windows does increment an fdcount! :) LOL