what are the rules u follow when u r writing critical
section of code?
Answers were Sorted based on User's Feedback
Answer / teja
1.The operation must be atomic
2.The atomicity is ensured by disabling the interrupts and
immediately after crictical section enabling the
interrupts..here slight precausion has to be taken i.e do
not forget the enabling of interrupts ....
| Is This Answer Correct ? | 14 Yes | 2 No |
Answer / bb
Always keep your execution code as minimal as possible in
the critical section.
Never use blocking calls in the critical section.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / vinod
a) Use Atomic Instructions
b) Remember to enable interrupts
c) Make the critical section code as small as possible.
(Prefer not more than 20 instructions)
d) Prefer not to call other functions from the critical
section. if u r calling, see that there is no critical
section in the other function too. Critical section is
bounded by Disable Interrupt and Enable Interrupt.
Check the example below.
fnA()
{
/* Critical Section Start */
Disable_Interrupt();
Some Instructions A ....
Call FnB();
/* do Something B */
Some Instructions B ....
/* Critical Section End */
}
fnB()
{
/* Critical Section Start */
Disable_Interrupt();
Some Instructions ..
Enable_Interrupts();
/* Critical Section End */
}
Now the Enable_Interrupts in fnB() will enable the
interrupts and hence "Some Instructions B .." in fnA()
which should have been in critical section will no more be
in critical section because the interrupts are already
enabled!!
Please check if this condition is handled by the Enable and
Disable functions. If you want suggestions on how to solve
this problem, do revert back
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / vineesh mca@tkm
1. Operation Must be Atomic
2. The process which are not currently executing its
rtemainder section are only allowed to make request to
execute its critical section
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / rk
1.The operation must be atomic
2.The atomicity is ensured by disabling the interrupts and
immediately after crictical section enabling the
interrupts..here slight precausion has to be taken i.e do
not forget the enabling of interrupts ....
| Is This Answer Correct ? | 1 Yes | 0 No |
what is difference between IRQ and FRQ ?
Describe different job scheduling in operating systems.
Write a small dc shell script to find number of FF in the design
Give an example of microkernel.
13 Answers Global Edge, Samsung,
What is a mission critical system ?
If two processes which shares same system memory and system clock in a distributed system, What is it called?
What do you mean by deadlock?
When would you choose top down methodology?
What is a Real-Time System ?
What is priority inversion ? and What is the solution ?
6 Answers Qualcomm, Tandberg, Wipro,
When would you choose bottom up methodology?
What is the difference b/n any GPOS and RTOS?Give suitable examples or characteristic of RTOS to support your answer. What changes can be done in a GPOS to make it work like a RTOS? What basic features will you support, if you have to design a RTOS?
8 Answers Bosch, Emulogic, L&T, Qualcomm,