User Tools

Site Tools


faq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
faq [2013/10/17 16:59] jxufaq [2013/12/02 19:56] (current) jxu
Line 4: Line 4:
 ====== General ====== ====== General ======
  
-====== FAQ about Assignment 2 and 3======+====== FAQ about Assignments ======
  
 **Question 1**: We are planning to add a certain additional functionality X to our program for the Assignment. Is adding the additional functionality X allowed? **Question 1**: We are planning to add a certain additional functionality X to our program for the Assignment. Is adding the additional functionality X allowed?
Line 52: Line 52:
 Start with the program "alarm_mutex.c"; each time make just a few changes to make it closer to satisfying the requirements of assignment 2; each time after making just a few changes, try to compile it and run it and make sure that the new version of your code is at least compilable and is at least executable. Always save several previous compilable and executable versions of your code so that you can revert back to a previous compilable and executable version of your code if you experience difficulty compiling and executing the most recent version of your code and/or find it difficult to determine what is possibly wrong with the most recent version of your code. Start with the program "alarm_mutex.c"; each time make just a few changes to make it closer to satisfying the requirements of assignment 2; each time after making just a few changes, try to compile it and run it and make sure that the new version of your code is at least compilable and is at least executable. Always save several previous compilable and executable versions of your code so that you can revert back to a previous compilable and executable version of your code if you experience difficulty compiling and executing the most recent version of your code and/or find it difficult to determine what is possibly wrong with the most recent version of your code.
  
 +**Question 4**: For Assignment 2, are we allowed to make modifications to the main() procedure and the alarm_thread function?
  
-**Question 4**For Assignment 3, can I include the errors.h file that was used in Assignment 2?+Answer to Question 4: 
  
-Answer to Question 4Yes.+You are allowed to modify the main() procedure and the alarm_thread in any way that meets the assignment requirements. 
 + 
 +**Question 5**: For Assignment 2, are we allowed to NOT use the alarm_list? 
 + 
 +Answer to Question 5:  
 + 
 +In the assignment description, it states that, 
 + 
 +*********************************************************** 
 +"A3. You are required to make the following changes to the program 
 +"alarm_mutex.c" to produce a program named "My_Alarm.c"
 + 
 +In your program "My_Alarm.c", after the alarm_thread has retrieved each 
 +alarm request from the alarm_list, instead of waiting for the specified 
 +number of n seconds and then printing out the alarm message as done in 
 +"alarm_mutex.c", the alarm_thread will immediately create a new thread, 
 +and that new thread will print out the alarm message repeatedly, once 
 +every n seconds; while the alarm_thread will be free to continue to 
 +retrieve and process new alarm requests from the alarm_list." 
 +************************************************************** 
 + 
 +In the assignment description, it clearly mentions "alarm_list" more than once, so clearly, using the "alarm_list" in the original "alarm_mutex.c" program in the way that is specified in the assignment description above is an important component of the assignment requirements. So the answer isin your program "My_Alarm.c", you MUST use the "alarm list" in the way that is specified in the assignment description above.
  
-**Question 5**: For Assignment 3, can I use an approach similar to the approach suggested in the answer to Question 3 above?  
  
-Answer to Question 4:  
  
-Yes. You should follow the advice given in the "F. Hints" section in the Assignment 3 description document. Once you have studied and understood the programs “pxsem/prodcons3.c”, and  “pxsem/prodcons4.c”, and have learned how to compile and execute these programs by following the instructions in the "README" file, you can use the programs “pxsem/prodcons3.c”, and  “pxsem/prodcons4.c”, as a template to write your own program for  Assignment 3. 
faq.1382029152.txt.gz · Last modified: 2013/10/17 16:59 by jxu

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki