Can select()'s reaction time be reduced?

Can select()'s reaction time be reduced?

Post by Ansa » Sun, 05 Mar 2000 04:00:00



Does select() poll underneath or does it wait for some sort of system
event?  If it does poll, anyone know what the rate is?

In my situation, I have to use select() rather than poll() because all
my input isn't STREAMS based.  What if I maybe constantly called select
() with a small timeout rather than a long one ..?  What I'm looking
for is a way to get a better reaction time to incoming data.

The problem is that I'm in the position of trying to get an app that
using select() for input to run as close (in speed) to an older app
that uses an IPC kernel driver for input.  What I'm seeing is that if I
run some high-throughput tests with both programs, the select() one is
slower by a good amount.  'quantify' shows me that it is spending a lot
of time idle in select() - dropping through to 'poll' for about 5% of
it's overall CPU time.  I'm wondering if (if select is polling) it is
probable that it's going like 'check', then data arrives, 'check again'
so I lose a little time on each chunk of data.  The driver-based one
would be immediate.

Thanks for any help,
   Mike

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Can select()'s reaction time be reduced?

Post by Andrew Giert » Sun, 05 Mar 2000 04:00:00


 Ansai> Does select() poll underneath or does it wait for some sort of
 Ansai> system event?

It waits.

 Ansai> In my situation, I have to use select() rather than poll()
 Ansai> because all my input isn't STREAMS based.

This is usually a non-issue; select and poll are generally implemented
together.

 Ansai> What if I maybe constantly called select () with a small
 Ansai> timeout rather than a long one ..?

this will waste CPU time (especially if many descriptors are being
selected on) to no good effect

Without knowing what platform you're using it is difficult to be
more specific.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
                           or <URL: http://www.whitefang.com/unix/>

 
 
 

1. how to reduce the time of 'CLOSE_WAIT'

When a process close a socket handle,  and use command '$ netstat -n ' ,

it show lots of message such as
tcp4       0      0  10.123.10.1.48453      10.123.10.1.12345
CLOSE_WAIT
.
and it will keep a long time of these status, a question about it is
that how to reduce
the time of  'CLOSE_WAIT' . and  will it waste system resource ?

any suggestion?

2. SoundCard Argh!!

3. Linus's reaction to Apple's Linux port?

4. scsi error.

5. measuring user reaction time for a key press?

6. How to check state of socket

7. RMS and reactions to him (best viewed in times new roman)

8. mouse locks in X after removing keyboard

9. It's not bad canned meat...

10. tidy(sys): reduce /var/adm/wtmp or "Am I blind"

11. Can't logon : no reaction after password

12. irst Reaction from the Italian Antitrust Authority to IACT-Italia's Petition vs. Microsoft