usleep problems

usleep problems

Post by cacciag.. » Fri, 19 Jul 1996 04:00:00



In using the function usleep under SOLARIS even though we provide
a value far below 20 milli seconds the smallest sleep time we get is 20 milli
seconds.  Has anyone else run inti this or is there some parameter that can be
tuned.

Thanks In Advance

 
 
 

usleep problems

Post by Bruce Barnet » Sat, 27 Jul 1996 04:00:00



> In using the function usleep under SOLARIS even though we provide
> a value far below 20 milli seconds the smallest sleep time we get is 20 milli
> seconds.  Has anyone else run inti this or is there some parameter that can be
> tuned.

You need to do two things:

        1) Add real-time scheduling to youe code
        2) use the timer14 module - Ask the sun people for this module.

--


 
 
 

usleep problems

Post by Super-Us » Sun, 28 Jul 1996 04:00:00




>> In using the function usleep under SOLARIS even though we provide
>> a value far below 20 milli seconds the smallest sleep time we get is 20 milli
>> seconds.  Has anyone else run inti this or is there some parameter that can be
>> tuned.

>You need to do two things:

>    1) Add real-time scheduling to youe code
>    2) use the timer14 module - Ask the sun people for this module.

    Easier, don't use usleep (as obviously it is broken).  Use poll().
    It's the only one that works.  With poll(), the lowest value you
    can use is 10 milliseconds.  Below this do the two things above.

Solaris nap results:

                 -- Time In Seconds --
loop    ms      poll    usleep     select

1000    1       10.0    20.0       0.0
100     10       1.0     2.0       0.0
10      100      1.0      .5       0.0
1       1000     1.0      .1       1.0

    -- Brad

--
Until the next disk seek...

 
 
 

1. Q: usleep/alarm problems!

Hi,
        Im doing a very tight loop reading from a socket and want to free up the
processor when there is no pending reads. I call yeild() but the CPU is still
pegged. I cant run usleep() as Im already using the Alarm signal in a parent
function.

Is there another way I can do a usleep without using alarms? The man page warned
me of thi happening!
Is there another way of reducing CPU load?
I use sginap() on IRIX and this works great.

Thanx .. Joe.

2. L0phtCrack ?

3. problem using usleep() and nanosleep()

4. multiple Hard Drives and CD Rom on Solaris 2.6 (Intel)

5. usleep timing problem

6. AlphaBSD problem...

7. help:Does usleep() work in mit pthread package?

8. Senior C Programmer on UNIX with SQL, needed now

9. pthreads and usleep

10. usleep in 2.5.1?

11. sleep(), usleep(), ...

12. need multi thread safe usleep() function

13. nanosleep or usleep