Socket Programming and Threading
Socket Programming and Threading
Video Link:
https://www.youtube.com/watch?v=4-vZtIUqIz8&feature=youtu.be
MCQ’s:
17-How can you ensure all threads that started from main must end in order in which
they started and also main should end in last
a) Join () method
b) sleep () method
c) wait () method
d) run () method
18-What are valid statements for suspend () and resume () method?
a) Suspend() method is deadlock prone.
b) If the target thread holds a lock on object when it is suspended, no thread can
lock this object until the target thread is resumed.
c) If the thread that would resume the target thread attempts to lock this monitor
prior to calling resume, it results in deadlock formation.
d) All
19-What is difference between starting thread with run () and start () method?
a) There is no difference
b) When you call start () method, main thread internally calls run () method to
start newly created Thread
c) Run () calls start() method internally
d) None
20-What state does Thread enter in when it has been created and started?
a) New
b) Runnable
c) Running
d) Waiting