2010.01.27 I have a couple of extra C programs in here to revive my use of command line arguments and command line Usage messages 2010.01.27 So this experiment does not actually allow for testing of unused event entries because I initialize all the event queue array entries with actual event Ids and event queues. This means I can do multiple pre-defined event queues, but I can't add or remove new events. I also don't test unused event entries, although that will probably work in this code. For example, I could modify this code to leave one of the event array entries with a 0 event Id indicating that there was no event queue associated with that event table entry. As long as the test calls did not ask to look for event 0 (the flag for unused event entries), then those entries will be skipped in searching for events. The next experiment 5 will introduce dynamic event creation and removal. 2010.01.27 Ok, so here's what happened. I had to switch to run-time init of my event queues because I had them in an array. I couldn't figure out how to use the static init macro that I used in experiment 3. I found a kernel function called init_eventqueue_head that I thought I could use to dynamically initialize the event queues in the array of events. I defined an event descriptor structure that had an eventId int and an event Queue. These structures were the entries in the event array. I put a loop in the module_init that initialized my event queue array with an event Id and a call to the kernel function init_eventqueue_head. The call to init_eventqueue_head gave me a pointer error. I reasoned that this was because the space was not allocated for the event_queue_head. The init_eventqueue_head expected to have uninitialized space already allocated. So I researched kmalloc and allocated the space and then called event_queue_head to initialize the event queues in a loop in the module_init function. That seemed to work. 2010.01.27 I had to switch to run-time init of the wait queues coded in module_init rather than using a static init macro as I did in experiment 3. 2010.01.27 Experiment 4 begins with experiment 3 but now sets up a set of kernel 3 event queues in an array rather than just one kernel event queue to hold waiting processes. I'll set MAX_QUEUE 4 and allocate all three queues at module init time, leaving one queue entry marked unused. I'll have no create or remove queue system calls. I'll change the wait and signal system calls and test programs to take one argument specifying the event number. I'll assume the event numbers are simply 1,2,3 for now. I'll reserve 0 to indicate an unused event table entry.