ENEE350 Computer Organization Lecture-19 Return to lecture notes
Types of Kernel/OS Processing
         Busy-waiting-simple to write, but wastes time
         
while(1)
{
while (new_event = false) wait();
handle_next_event();
}
         
         
Polling-more efficient, but still wastes time polling I/O devices,users, etc.
         
 while(1)
{begin(main_event)
handle main_event();
end(main_main_event)
while (next_port =true)
     {poll_next_port();
      if(new_event) handle_next_event();
      }
}
         
Event-Driven-More complex to write, maintain, and diagnose, but more resource and time efficient.
         
Single server/Single-queue
         
 while(1)
{if(new_event)
   {getnextevent();
     processnextevent();
   }
else handle main_event();
}
         
Single server/Multiple-queue
         
 while(1)
{if(new_event)
   {select_next_event(); --priority-based
     process_next_event();
   }
else handle main_event();
}
         
         
Multiple server/Multiple-queue
         
 while(1)
{if(new_event)
   {select_next_queue();
    select_next_event();
     process_next_event();
   }
else handle main_event();
}
         

Return to lecture notes