Thursday, December 02, 2004

Deadlock Program - edited

1:13pm
Hey! So I am in the computer lab programming, and I thought I would give you all a glimpse into my thoughts while I'm writing a program. I'll try and post often. Unless I lose track of time. Or strangle myself with the mouse cord. Just kidding.

I started this program about a month ago when it was assigned in class. Back then, I had a plan. Now, I don't remember the plan; I don't even remember what this program should do.

Files made:
driver.java
process.java
resource.java
check.java

1:47pm
It's going well right now. I have my driver finished I think. It creates three Resources (a, b, and c) and three Processes (p1, p2, and p3) and runs the threads.

This program is easy so far!

2:01pm
I'm stuck for the first time today. It's not so easy anymore.

2:15pm
Eeek! My professor who assigned this program just walked in. He is teaching another class. Don't look at my screen! Don't look at my screen! Programming with a professor looking at your screen is like doing algebra on the chalk board. You revert back to a 7th grade level.

I just explained to a classmate the concept of a scope of a variable. I do deserve to graduate! I do! I do!

Files made:
driver.java
Resource.java
Process.java
Check.java
Monitor.java

3:20pm
Good news! The professor left the room. I can work in peace again. No updates to the program because I haven't typed a single thing in 15 minutes. I was looking in the text book to see how exactly to detect deadlock. It wasn't helpful.

Files made:
driver.java
Resource.java
Process.java
Check.java - still completely empty

Files deleted:
monitor.java

3:32pm
Still haven't typed anything. I took a break. Called my boyfriend. Ate a peanut butter and honey sandwich.

Deadlock: a process or thread is in a state of deadlock if it is waiting for a particular event that will never occur

4:01pm
The program compiles but I get an unreachable statement. My eyes are getting blurry. Is it my contacts or have I been starting at the screen for too long?

I'm also starting to smell something that reminds me of a soldering iron. The electronics lab is on the floor right above me. Maybe that's it. Wait...if someone is up there soldering, that means the lab is in session. The lab that I am registered for. The lab that starts at 3:00. The lab that I should be in right now instead of downstairs programming. Shoot!

In my defense, I wasn't planning on going to the lab today because my T.A. has left the country; he flew out on Monday for Bosnia for a mission trip or something. I'll make it up this weekend I guess.

4:15pm
I hate learning new things at the end of the year, which could have helped me at the beginning of the year.

I also hate learning new things at the end of my college career, which could have helped me since my freshmen year.

On the command line, you can put an "&" to open a window and directly return to the command line, instead of opening the window and then closing the window to return to the command line. That "&" saves me about .5 sec everytime I compile a program.

If I compile a program on average 50 times, and I do 10 programs a semester, and I've been here 9 semesters....that's....*can't do math in head*....2250 seconds? That's 37 minutes. 37 minutes of my life wasted closing a window to return to the command line.

4:41pm
I don't think I've made any progress in the last 45 minutes. I don't smell solder anymore though. Maybe the other students in my electronics lab are giving up too. No. I can't give up now. I will get this done.

Files made:
driver.java
Resource.java
Process.java
Check.java - still completely empty

Files deleted:
monitor.java

Files undeleted:
monitor.java

4:56pm
Bad news. Really bad. Bad = very yes. One of my classmates, working on the same program that I am, asked the professor a question about it. Unfortunately, the prof revealed that our whole algorithm is incorrect. The way the prof suggested to do it is much easier than what we're doing. But this means that work I have done for the past 3.75 hours was a waste of time.

Sigh. Anybody got a mouse cord?

I think I'm done for the day.

[edit - to make this more clear, I moved the entries to one post. Sorry if I deleted your comment in the process!]

3 Comments:

At 11:58 AM, Anonymous Anonymous said...

That was so funny. It cracked me up. You do deserve to graduate. I am so glad you know about the scope of a variable! That is sooooo important. Linda

 
At 3:01 PM, Anonymous Anonymous said...

I am so happy you know about that stuff too. It means you are a nerd. My nerd at that. But please, do not hang yourself with a mouse cord because I would never be able to look at a mouse again, and I like computers.
Josh

 
At 11:28 PM, Anonymous Anonymous said...

Suzie, You are the coolest person alive!

 

Post a Comment

<< Home