<p>Hi everybody!</p>
<p>As I understood from the code, binding with the local monitor is performed during the bootup process for the domains that are not initial (all except init, monitor and mem_serv) through the method "monitor_client_lmp_bind" in lib/barrelfish/monitor_client.c. It consists of&nbsp; sending the endpoint to the monitor, registering for receive events and performing the continuation which in this case only sets the variable request_done = true. When the bootup process continues there is a while-loop that confused me, given below (method "barrelfish_init_onthread" in lib/barrelfish/init.c):</p>
<p>&nbsp;&nbsp;&nbsp; request_done = false;<br />&nbsp;&nbsp;&nbsp; err = monitor_client_lmp_bind(mcb, monitor_bind_cont, &amp;init_complete_err,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_ws, DEFAULT_LMP_BUF_WORDS);<br />&nbsp;&nbsp;&nbsp; if (err_is_fail(err)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return err_push(err, LIB_ERR_MONITOR_CLIENT_BIND);<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; // dispatch events on the waitset until monitor binding completes<br />&nbsp;&nbsp;&nbsp; while (!request_done) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err = event_dispatch(default_ws);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (err_is_fail(err)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return err_push(err, LIB_ERR_EVENT_DISPATCH);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }</p>
<p>My question, is there a possibility of reaching the while loop with boolean value still being false? And if so (monitor binding is still not complete), which events can be dispatched on the waitset since even monitor binding is not complete at that stage? I am asking because I think that while-loop is not needed at all, and if that's not true than I am missing something fundamental here.</p>
<p>Thanks in advance!</p>
<p>Borislav Nikolic</p>