[Barrelfish-users] wait/sleep/timer
Georgios Varisteas
yorgos at kth.se
Mon Jul 2 11:02:06 CEST 2012
Thanks Kornilios. This looks exactly like what I was looking for. However, it doesn't look like this will block the thread either so it requires something else to be happening in between periods or it'll die, right? Something like messages_handler_loop()?
cheers,
Georgios
________________________________________
From: Kornilios Kourtis [kornilios.kourtis at inf.ethz.ch]
Sent: Monday, July 02, 2012 10:34
To: Georgios Varisteas
Cc: barrelfish-users at lists.inf.ethz.ch
Subject: Re: [Barrelfish-users] wait/sleep/timer
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