[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-code
Subject:    Re: [osol-code] shorter "nanosleep"
From:       "Garrett D'Amore" <garrett () damore ! org>
Date:       2008-01-15 17:43:48
Message-ID: 478CF0D4.5030609 () damore ! org
[Download RAW message or body]

Ben Steven wrote:
> Is there any _supported_ way to sleep shorter than 0.5 ms on average?
> 
> Using lock-free data structures implies waiting -> the current "nanosleep" \
> functionality does not satisfy our needs because it's increasing the latency :(. 

I think you need to either increase the system clock frequency, or use a 
different timer.  From userland, there aren't any obvious hardware 
timers available.  From the kernel, there are many devices that have 
physical timers and timer interrupts on them (most NICs for example), so 
it might be possible to hook up to one of those.  But unless you're 
doing this as part of the work for one of those drivers, its probably 
too exotic to make practical use of.

If you have an extra CPU core to waste, you could implement your own by 
spinning and checking the values of gethrtime(), but its extraordinarily 
CPU wasteful.

    -- Garrett

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic