Productivity

Reading time ~2 minutes

Well, that was a hell of a day.

Ok, it wasn’t that bad. And hell, I’ve only been up for 12 hours, so what am I complaining about?

Still, I managed to get my first programming assignment done (3 full days before the EARLY due date, no less, which’ll be worth an extra 5%!), finish a homework for my other class, cook myself dinner and clean up after it, and protest a small loss of points on my last homework from my OS class because my answer WAS correct…just wordy.

Now, this may not sound like much of an accomplishment, but keep in mind that in order to get that programming assignment done, I had to (re)teach myself c++, learn how to use g++ (compiler), get x11 forwarding working with ssh (ok, that was easy), and THEN, and only then, could I work on the assignment.

Actually the biggest pain in the ass was getting cin to work like advertised. Which I never did. I just used another option, and I’m a bit worried that the ol’ professor will be miffed that I didn’t “just” use cin, since I already know that’s more or less what he was expecting. But the assignment wasn’t about cin, it was about fork and execl and wait, and THOSE I have working perfectly. In fact, it took me far less time to figure those out then it did to figure out my cin workaround.

Of course, if anyone knows of a way for wait() to wait for ALL child processes to exit, let me know. I ran across someplace suggesting it would just do that, but when I tried it, it exited right after I quit my first child process. So I did something different.

Anyway, kind worried he won’t like my code or my comments or that I didn’t test thoroughly enough. But that’s the advantage of getting it done this early…I have a few days left to ask questions and retest.

So, anyhoo…

I feel accomplished. It feels weird. I almost rather I’d played games all day.

2008-02-05 19:18:43 -- qkslvrwolf
Not that anyone cares, but I got full credit for this one. Didn't lose a point. YAY!

2008-01-31 18:42:05 -- qkslvrwolf
Yeah, I basically did that. Put a vector in to store the pid's, then went through on an exit call and waited on each id. I have a feeling there is a more elegant way to do it, but maybe not. I have to be honest, I feel the power of c++, but since I kinda doubt I'm ever gonna be doing c++ for a living, I wish we were using a slightly "higher" level language, like java. Or lower level like c, so that I could understand most of the linux related code a bit better. Not that doing c++ isn't going to help with the linux related stuff too, but if I gotta be doing it...

2008-01-28 21:12:25 -- James
Is this what you were going to ask me about? What was the way you found? A quick search isn't finding anything. I guess you could keep a list of all your child PIDs and call waitpid for each of them. Man it's been WAY too long since I did this stuff... but I don't envy you if you're having to do C++.