main: Always pin to core #1

Pin the MiSTer process to core #1 in order to stay clear of the hardware
interrupt handlers running in the Linux kernel on core #0.  This gives a
consistent improvement in the main loop cycle time of about 6-7x.
This commit is contained in:
David Holm
2019-01-04 22:53:06 +01:00
parent 9d21437895
commit dfa6dc97bd

View File

@@ -35,22 +35,13 @@ const char *version = "$VER:HPS" VDATE;
int main(int argc, char *argv[])
{
/*
//placeholder for CPU1 dedicated process
if (!fork())
{
cpu_set_t set;
CPU_ZERO(&set);
CPU_SET(1, &set);
sched_setaffinity(0, sizeof(set), &set);
while (1)
{
sleep(2);
printf("Tick\n");
}
}
*/
// Always pin main worker process to core #1 as core #0 is the
// hardware interrupt handler in Linux. This reduces idle latency
// in the main loop by about 6-7x.
cpu_set_t set;
CPU_ZERO(&set);
CPU_SET(1, &set);
sched_setaffinity(0, sizeof(set), &set);
fpga_io_init();
fpga_gpo_write(0);