[Barrelfish-users] wait/sleep/timer

Kornilios Kourtis kornilios.kourtis at inf.ethz.ch
Mon Jul 2 10:34:13 CEST 2012


Hi Georgios,

On Mon, Jul 02, 2012 at 08:04:08AM +0000, Georgios Varisteas wrote:
> My question is: what's currently the lightest way to periodically call
> a function?
> 
> I've used timer in the past but that feels like an overkill when I just
> want to sleep a thread for a few milliseconds; I reckon that it doesn't
> really block the thread but it needs a blocking msg listener for that.
> The common linux sleep and usleep functions do exist in newlib but I
> haven't really figured out how to use them in x86_64. Any other hints
> on that?

I think the best way to achieve what you are describing is by using the
functions in lib/barrelfish/deferred.c. Specifically,
periodic_event_create() should do the trick. Note that sleep() and
friends are part of POSIX and are not currently supported in barrelfish.

cheers,
Kornilios.

-- 
Kornilios Kourtis



More information about the Barrelfish-users mailing list