Trying symmetric multiprocessing

  1. Log in as a normal user.
  2. Start some processes that run indefinitely. For example, use the hogs utility to display which processes are using the most CPU:
    hogs -n -%10
      
    
  3. Use pidin sched to see which processor your processes are running on.

    If you're using the IDE, you can use the System Information perspective to watch the threads migrate.

  4. Create a program called greedy.c that simply loops forever:
    #include <stdlib.h>
    
    int main( void )
    {
        while (1) {
        }
    
        return EXIT_SUCCESS;
    }
      
    
  5. Compile it, and then run it:
    qcc -o greedy greedy.c
    ./greedy &
      
    

    On a uniprocessor system, this would consume all the processing time (unless you're using adaptive partitioning). On a multicore system, it consumes all the time on one processor.

  6. Use pidin sched to see which processor your other processes are running on. They're likely running on different processors from greedy.