[Barrelfish-users] wait/sleep/timer

Kornilios Kourtis kornilios.kourtis at inf.ethz.ch
Mon Jul 2 11:21:33 CEST 2012


Hi Georgios,

On Mon, Jul 02, 2012 at 09:02:06AM +0000, Georgios Varisteas wrote:
> 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()?

Yes.

Looking at the messages_handler_loop() (copied below), you might (or might not)
want to add a yield function (e.g., thread_yield() if you are using threads) to
give an opportunity to other applications to run on this core.

| void messages_handler_loop(void)
| {
|     while (1) {
|         messages_wait_and_handle_next();
|     }
| }


cheers,
Kornilios.

-- 
Kornilios Kourtis



More information about the Barrelfish-users mailing list