What is race condition ?? (Threading concept) TCS 2 sept10
Answer Posted / mkjhamca05
This example shows a trivial software race condition. A
software race condition occurs when the execution of a
program is affected by the order and timing of a threads
execution. Most software race conditions can be alleviated
by using synchronization variables to control the threads'
timing and access of shared resources. If a program depends
on order of execution, then threading that program may not
be a good solution, because the order in which threads
execute is non deterministic.
In the example, thr_continue() and thr_suspend() calls
continue and suspend a given thread, respectively. Although
both of these calls are valid, use caution when implementing
them. It is very hard to determine where a thread is in its
execution. Because of this, you may not be able to tell
where the thread will suspend when the call to thr_suspend()
is made. This behavior can cause problems in threaded code
if not used properly.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain access modifiers in java.
Is string a wrapper class?
What is the final blank variable?
When super keyword is used?
What java ide should I use?
What is the difference between a loader and a compiler?
How do you find the maximum number from an array without comparing and sorting?
What are java packages? What's the significance of packages?
What are the disadvantages of object oriented programming?
What do you understand by casting in java language?
What is difference between word and integer?
What happens if I remove static from main method?
Can we create object of static class?
What is the difference between char and char *?
What are use cases?