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
What invokes a thread's run() method in java programming?
Explain illegalmonitorstateexception and when it will be thrown?
What are the Main functions of Java?
What is math in java?
I want to store more than 10 objects in a remote server? Which methodology will follow?
Can we clone singleton object in java?
what are three ways in which a thread can enter the waiting state? : Java thread
What’s meant by anonymous class?
Can we pass a primitive type by reference in java? How
Difference between == and .equals() ?
What are different data types?
How many bits is size_t?
What is int argc char * argv?
Does the order of public and static declaration matter in main method?
Why does java not support operator overloading?