A non-transitory computer-readable recording medium storing a memory access control program executed by a computer of an image forming apparatus, the image forming apparatus including a panel display unit, an image forming unit, a random-access memory, a NAND flash memory, and storage storing a panel application program for controlling the panel display unit and a main application program for controlling the image forming unit, the memory access control program causing the computer to function as:
- a first core executing the panel application program to constitute a panel controller operating system;
- a second core executing the main application program to constitute a main controller operating system;
- wherein
- the random-access memory includes a shared region accessible through both the first core and the second core, and an excluding flag in the shared region,
- the NAND flash memory is excludingly accessible by one of either the first core or the second core obtaining the excluding flag, the one of either the first or second cores having obtained the excluding flag thereby excluding the other of the first or second cores from obtaining the excluding flag,
- the first core executes a boot loader, the first core accessing the NAND flash memory by executing the boot loader, and the first core causing the boot loader to sequentially load, from the NAND flash memory, a startup program for the panel controller operating system and for the main controller operating system, and the first core executing a starting process concurrently with loading an application program operating on the panel controller operating system to cause the random-access memory to hold the application program;
- the second core executes a process of starting up the main controller operating system in parallel with at least loading of the startup program for the panel controller operating system by the first core;
- the first core monitors whether it may obtain the excluding flag, and the second core monitors whether it may obtain the excluding flag;
- the first core and the second core respectively have caches containing excluding-flag-monitoring data content matched with data content in the random-access memory;
- if the first core is excluded from obtaining the excluding flag, the first core monitors the excluding flag according to the excluding-flag-monitoring data content in its cache while looping in a busy-waiting state, and if the second core is excluded from obtaining the excluding flag, the second core monitors the excluding flag according to the excluding-flag-monitoring data content in its cache while looping in a busy-waiting state;
- and
- when one of either the first core or the second core accessing the NAND flash memory through having obtained the excluding flag terminates its access, the excluding flag is thereby released, such that the other core, being in the busy-waiting state, obtains the excluding flag.