From: Scott Lurndal on
jt(a)toerring.de (Jens Thoms Toerring) writes:
>In comp.unix.programmer Jasen Betts <jasen(a)xnet.co.nz> wrote:
>> select() prefers the lowest numbered file descriptor it's asked to
>> test/watch so that should be easy to arrange,
>
>Just curious: in what sense does select() "prefer" lower numbered
>file descriptors?

for(i=0; i < num_file_descriptors; i++){
if (pending_select[i].is_ready) {
return i;
}
}
From: Scott Lurndal on
David Schwartz <davids(a)webmaster.com> writes:
>On Apr 7, 4:43=A0am, Jasen Betts <ja...(a)xnet.co.nz> wrote:
>
>> select() prefers the lowest numbered file descriptor it's asked to
>> test/watch so that should be easy to arrange,
>
>Huh?!
>
>DS

on the call, but not subsequent to the wait.

scott
From: Peter Olcott on

"Chris Friesen" <cbf123(a)mail.usask.ca> wrote in message
news:0-6dnQ-LxrwscSHWnZ2dnUVZ_judnZ2d(a)posted.sasktel...
> On 04/07/2010 12:32 PM, Peter Olcott wrote:
>
>> Likewise with my scheduling of my
>> processes as compared to the OS scheduling them for me.
>
> The OS has knowledge of what else the system is doing that
> you don't have.
>
>> Is there any way to tell the hardware cache to load
>> specific
>> data?
>
> Generally yes, but it requires assembly code.
>
> Chris
>

OK thanks.


From: Joe Pfeiffer on
scott(a)slp53.sl.home (Scott Lurndal) writes:

> jt(a)toerring.de (Jens Thoms Toerring) writes:
>>In comp.unix.programmer Jasen Betts <jasen(a)xnet.co.nz> wrote:
>>> select() prefers the lowest numbered file descriptor it's asked to
>>> test/watch so that should be easy to arrange,
>>
>>Just curious: in what sense does select() "prefer" lower numbered
>>file descriptors?
>
> for(i=0; i < num_file_descriptors; i++){
> if (pending_select[i].is_ready) {
> return i;
> }
> }

That isn't select() having a preference, it's you having a preference.
If you'd written

for(i=num_file_descriptors-1; i >= 0; i--){
if (pending_select[i].is_ready) {
return i;
}
}

the code would pick the highest descriptor, not the lowest. There's
also the question of how you're getting the signal set into your
pending_select[] array.
--
As we enjoy great advantages from the inventions of others, we should
be glad of an opportunity to serve others by any invention of ours;
and this we should do freely and generously. (Benjamin Franklin)
From: David Schwartz on
On Apr 7, 1:55 pm, sc...(a)slp53.sl.home (Scott Lurndal) wrote:
> David Schwartz <dav...(a)webmaster.com> writes:
> >On Apr 7, 4:43=A0am, Jasen Betts <ja...(a)xnet.co.nz> wrote:

> >> select() prefers the lowest numbered file descriptor it's asked to
> >> test/watch so that should be easy to arrange,

> >Huh?!

> on the call, but not subsequent to the wait.


I still have no idea what you're talking about.

DS