mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-10 21:01:49 +00:00
rom_prefetcher: Yield CPU after each request
By blocking on a timeout, we yield the CPU in order to give a concurrently running sporadic process a chance to obtain ROM modules. Otherwise, such requests would be deferred until the ROM prefetcher completes its operation or in the unlikely event that the prefetcher gets preempted. Fixes #1378
This commit is contained in:
parent
86eb3f4a0d
commit
db56946ba9
@ -21,6 +21,7 @@
|
||||
#include <base/env.h>
|
||||
#include <base/sleep.h>
|
||||
#include <os/config.h>
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
volatile int dummy;
|
||||
|
||||
@ -112,6 +113,7 @@ int main(int argc, char **argv)
|
||||
* Prefetch ROM files specified in the config
|
||||
*/
|
||||
try {
|
||||
Timer::Connection timer;
|
||||
Genode::Xml_node entry = config()->xml_node().sub_node("rom");
|
||||
for (;;) {
|
||||
|
||||
@ -130,6 +132,9 @@ int main(int argc, char **argv)
|
||||
|
||||
/* proceed with next XML node */
|
||||
entry = entry.next("rom");
|
||||
|
||||
/* yield */
|
||||
timer.msleep(1);
|
||||
}
|
||||
} catch (...) { }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user