[Barrelfish-users] wait/sleep/timer

Simon Peter speter at inf.ethz.ch
Mon Jul 2 11:24:19 CEST 2012


Bear in mind that messages_handler_loop() is a deprecated function. You 
should use event_dispatch() instead.

event_dispatch() will properly block your thread when waiting for 
deferred events.

Simon

On 02.07.2012 11:21, Kornilios Kourtis wrote:
> 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.
>




More information about the Barrelfish-users mailing list