SYSC 3303 D

5 Pages
Unlock Document

Systems and Computer Engineering
SYSC 3303
All Professors

Question A 9 marks1What are the two ways of creating a Java Thread Write the first line of a Java class up to thefor each of the two ways showing that you know the Java syntax corresponding with each way Ensure that you clearly state which Java class goes with which way of creating a thread 4 marks 2 marks eachosubclass Thread class myClass1 extends Threadoimplement the Runnable interface class myClass2 implements Runnable2What method must be present in a class representing a Java Thread for it to do useful work 1 mark orun brackets optional3How is the above method invoked 1 mark oAnother thread usually the thread that created myThread executes myThreadstart where myThread is the name of the new thread4When running a multithreaded Java program on a uniprocessor machine will we have true concurrency Briefly explain why or why not 3 marks 1 mark for no 2 marks for why notoNooA uniprocessor can only execute one thread at a time and for true concurrency we need to be able to execute multiple threads simultaneouslyQuestion B 6 marks1Identify each of the two types of thread synchronization discussed in the lectures 2 marks 1 mark eachomutual exclusionocondition synchronization2For each type of thread synchronization identify how we implement it in Java ie what is provided by Java to allow us to implement this type of thread synchronization Ensure that you clearly state which Java constructs go with which thread synchronization type 4 marks 2 marks eachomutual exclusion synchronized methods or synchronized keyword in method descriptionocondition synchronization wait notify and notifyAll 1 mark for wait 05 marks each for notify and notifyAllQuestion C 15 marks
More Less

Related notes for SYSC 3303

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.