Orion S. Lawlor (ffosl@uaf.edu) CS 321, 2005/2/2 PROJECT1 Code This is a simple user-space "event handling" library, which calls some event-driven user code. INSTALLATION This is a C++ program with two source files: example.cpp and oslevent.cpp. The provided Makefile should work on UNIX. The code only depends on the C++ STL, so it should build with basically any compiler. TOPIC CHANGES My interface was fine--no changes needed. My example code from the topic paper had a few minor bugs: - I forgot to include - I left off a parenthesis after "->add(new" - I passed the wrong format code to printf for the string. - I had an infinite loop with the "late" sequencers-- at step 4, each sequencer would create another one. I've fixed all of these in example.cpp. DESIGN CHANGES I didn't have to change my design at all--everything worked as I expected. This probably happened because my problem is so simple. EXAMPLE RUN The example program prints out olawlor@dellawlor:~/class/cs321/www/proj1/example/code> ./example foo: step 1 of 6 bar: step 1 of 3 foo: step 2 of 6 bar: step 2 of 3 foo: step 3 of 6 bar: step 3 of 3 foo: step 4 of 6 foo: step 5 of 6 late: step 1 of 4 foo: step 6 of 6 late: step 2 of 4 late: step 3 of 4 late: step 4 of 4 olawlor@dellawlor:~/class/cs321/www/proj1/example/code> The tasks indeed execute in first-in, first-out style. Because foo was added first, it's the first to execute. Foo and bar then alternate until bar finishes, then only foo runs until it spawns "late". CONCLUSION This was a fun and easy project, and I'd like to think about how to add prioritized execution sometime.