SWALEH ALAM 48456 LAB NO: 10
Threading
Exercise 1: -
1:Write python script create three different threads belonging to different thread classes
1
SWALEH ALAM 48456 LAB NO: 10
2:Enhance example 3 code adding few more functions to the class and then check if the
thread alive at a particular instance of time.
2
SWALEH ALAM 48456 LAB NO: 10
3: Explain the given code.
Answer: The given code handles the two threads in order to ensure they have completed before exiting
the desire process. The thread includes the current thread, and since joining the current thread is not
allowed (it introduces a deadlock situation), it must be skipped.
Exercise 2: -
1:Write a python program to create a queue of processes (threads) and ensure that when one
process will be doing a particular activity no other thread could interrupt the thread.
3
SWALEH ALAM 48456 LAB NO: 10
4
SWALEH ALAM 48456 LAB NO: 10
5
SWALEH ALAM 48456 LAB NO: 10