201k views
4 votes
If we run 5 instances of ThreadA() and 1 instance of ThreadB(), what can be the maximum number of threads active simultaneously in the Critical Section

1 Answer

2 votes

Answer:

Only one

Step-by-step explanation:

When dealing with a critical section, only one thread may be active in it a single moment. If more than one thread is trying to gain access then only one will be allowed while the other would be placed in a queue to access it next. This is mainly done in order to prevent two threads/processes from accessing/manipulating the same variable or data at the same time which can cause program breaking errors to occur.

User Klemen Rejec
by
5.3k points