Question
In a multithreaded environment, which of the following
synchronization mechanisms is used to prevent race conditions?ÂSolution
A semaphore is a synchronization mechanism that is crucial for controlling access to shared resources in a multithreaded environment. It serves as a signaling mechanism that can be used to prevent race conditions, which occur when multiple threads attempt to modify shared data simultaneously, leading to unpredictable outcomes. Semaphores maintain a count of available resources and ensure that only a certain number of threads can access the critical section of code at any given time. When a thread wants to enter a critical section, it checks the semaphore's value; if it is greater than zero, the thread decrements it and proceeds; otherwise, it is blocked until the semaphore is released by another thread. This prevents multiple threads from executing critical sections concurrently, thereby eliminating race conditions and ensuring data consistency. Option B (Fork) - Fork is used to create new processes, not for synchronizing access to shared resources. Option C (Signal) - Signals are used for inter-process communication but do not provide the same level of resource control as semaphores. Option D (Context Switch) - Context switching refers to the operating system's ability to switch between processes and threads, which does not inherently prevent race conditions. Option E (Stack) - A stack is a data structure and does not serve any synchronization purpose in multithreading.
Under the RBI’s KYC guidelines, “beneficial owner” for a company is identified as_________.
The costs which were incurred in the past and ignored under capital budgeting are known as_____.Â
________ deals with Disclosure of Accounting Policies.
A company’s ROE is 18%. Net profit margin is 12%, asset turnover is 1.5 times. Calculate the equity multiplier.
Ashutosh is a horse dealer. Tausif approaches Ashutosh for a horse. Ashutosh lends a horse which he knows to be vicious, to Tausif. Ashutosh doesn't dis...
Which of the following is NOT an example of capital receipt?
The written down value of Machinery is ₹ 12,00,000. The original cost of the Machinery is ₹ 20,00,000. It is sold for ₹ 24,00,000 during the year ...
A firm evaluates two projects with identical expected cash flows, but Project A has higher variability. If the firm is risk-averse, what would be its de...
ABC analysis is mainly used for:
A statutory auditor of a company needs to report fraud/suspected fraud within _____ of his/her knowledge of the fraud.