guzzle - /* We should schedule this at low priorities. */...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * guzzle: Sit in the background in a long loop and display * characters on the console occasionally. * * This is intended to help with scheduler testing. */ #include <stdio.h> #include <unistd.h> #define TOP 1<<25 /* real long loop */ /* This program is a ridiculous, compute-bound program */
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: /* We should schedule this at low priorities. */ int main(int argc, char *argv) { volatile int i; int ch = '+'; if (argc == 2) { ch = argv[1][0]; } for (i=0; i&lt;TOP; i++) { /* tight loop */ /* that eats up cycles */ if ( (i%10000) == 0) { putchar(ch); } } return 0; }...
View Full Document

Ask a homework question - tutors are online