Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Explain clearly why competition synchronization is not a problem in a program

ID: 3549172 • Letter: 1

Question

1.      Explain clearly why competition synchronization is not a problem in a programming environment that supports coroutines but not concurrency.


2.      What is the best action a system can take when deadlock is detected?


3.      Busy waiting is a method whereby a task waits for a given event by continuously checking for that event to occur. What is the main problem with this approach?


4.      In languages without exception-handling facilities, it is common to have most subprograms include an

Explanation / Answer

1.Competition synchronization is not necessary when no actual concurrency takes place simply because

there can be no concurrent contention for shared resources. Two nonconcurrent processes cannot arrive

at a resource at the same time.


2.Well, you can't always detect deadlocks in the first place due to the Halting Problem.

But assuming you have reasonable suspicion that is has occurred, then you don't have much choice. You can:

Interrupt (i.e. send a signal/exception to) all the threads holding the lock. They will have to be able to handle the resulting interrupt, though.

Kill all the threads/processes involved. This is a drastic action, and it saves the rest of the system at the expense of the risk that some data will probably be lost by the program.


5.When there is a new error to be detected, the source code of the exception handling function must be updated - and seperately compiled. Also we have the over head of sending an additional parameter