Lab 4: Comments

Lab 4 has been graded by Ms. Saranya Sekar. You will receive an individual email with your mark details (sent to your SoC UNIX @comp.nus.edu.sg email address). If you have doubts about your code, comments given, or marks, please seek clarification with Ms. Saranya (a0076996@nus.edu.sg) and me. Here are the common mistakes that students made in Lab 4.

1. Did not kill child processes when exiting bush. This can be done with killpg(0, SIGHUP)
2. Did not catch SIGHUP signal at bush. So when bush calls killpg(0, SIGHUP), it hangs itself up!
3. Do something extra after execvp() or exit(). Nothing after the execvp() or exit() calls will run. For execvp(), the core image would have been replaced, so the subsequent code wouldn’t matter unless execvp() causes an error. For exit(), the process would have ended, so the subsequent code wouldn’t matter.
4. Mixing up signal() and kill(). signal() is not used to send a signal, but rather to install a customized signal handler. kill() is used to send a signal.

Posted in lab

Lab 6

Here is your Lab 6.

Lab 6 is a graded exercise. Submit your solution to the IVLE workbin before Friday, 14 October 2011, 10:00pm. It is longer than the past labs, so please plan your time properly.

Midterm Test: Information

Time: 1200 – 1400
Date: 7 October (Friday)
Venue: LT15 and COM1 208.

Scope: Lecture 1-6, Lab 1-5, Tutorial 1-5

The test is close-book, but you are allowed to bring in one A4-size, double sided, crib sheet.

The total mark is 80. Time allowed is 90 minutes, so you should allocate x minutes to answer a question worth x marks.

You should write your matriculation number in pen. For the rest, either pen or pencil is fine (as long as it is clearly readable).

When answering question, please answer succinctly and direct to the point.

The following students should report to COM1 208 for the midterm test.
Continue reading

Lecture 7: Deadlock

30 September, 2011 This week we will look at deadlock in more details, as well as other nuisances caused by buggy synchronization code, including livelock, starvation, and priority inversion. Having a hardcopy of slides during lecture would be helpful. Be prepare to take notes during lecture.

Download Slides: PDF

Reading:

  • Chapter 6 (exclude 6.5, 6.7.1, 6.7.2, 6.8)

Related Wikipedia entries are listed below. These are for students who are keen to go beyond what is covered in CS2106. Read the articles with a critical mind since Wikipedia is editable by anyone.

Lab 3: Comments

Lab 3 has been graded by Mr. Xiang Yongzhou. You will receive an individual email with your mark details (sent to your SoC UNIX @comp.nus.edu.sg email address). If you loose marks for reasons not specified below, please seek clarification with me or Mr. Xiang (xiangyongzhou@nus.edu.sg). Here are the common mistakes that students made in Lab 3.

  1. For Question 1, if you gave an answer with a wrong time unit (ms vs. ns), you get 0 marks.
  2. For Question 1, if the question asks for average time and you give total time, you get 0 marks. Partial credits of 0.5 is given if you (a) shown working but gave a wrong answer, (b) stated that the overhead is 100 times without actually calculating the overhead, (c) gave a correct answer but in a unit other than ns (e.g., 0.4ms)
  3. For 1(d), 0.5 mark each for the first and second part. Again, incorrect units do not earn you any marks.
  4. For 2(a), you get 1 mark for explaining what does defunct process mean and 1 mark for explaining why it happens.
  5. For 3(a), you get 0.5 for answering what are the proocesses that constitute the process group and 0.5 for explaining who is the leader. If you only list the process IDs without explaning, no marks is given.
  6. For 3(b), you get 1 mark for putting a negative sign in front of the process group ID. No marks for using killpg.

We have to penalized some students. You have worked hard on the labs, please do not throw away your marks due to careless mistakes and not following instructions!

  1. Some of you did not put down your matriculation number correctly. I gave a warning this time, but for subsequent labs, we will deduct 3 marks!
  2. Please submit a text file, not a MS Word document! (We deducted 3 marks for one student due to this reason).
  3. Please do not edit any lines starting with “#”. (We deducted 3 marks for one student due to this reason).
  4. Please do not start your answer with “#”. Our program treats all lines starting with “#” as special lines. My instruction is unclear this time, but we will deduct 3 marks for subsequent labs.
  5. For late submission, 0.1 marks per minute might sound very little, but it accumulates quickly. So please manage your time and try to finish your lab early, do not wait until the last minute.

Reminder: have you completed the mid-term feedback survey?

Mid-term Feedback Survey

We are near the half-way point of the semester, and this is a good time to take a look back and see how we are doing. The teaching team of CS2106 would much appreciate if you can let us know how we are doing and how we can improve ourselves.

Kindly please help us by spending a 5-10 minutes of your time in answering the anonymous survey. (due 4 October 2011).  Your feedback is important to us!