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


Please Help Members By Posting Answers For Below Questions

What is the java virtual machine?

576


What class allows you to read objects directly from a stream in java programming?

504


What is the final class modifier?

551


What is string subsequence method?

621


How do you create an array in java?

525






What is class variable java?

578


What is the list interface?

600


Why do we declare a class static?

533


What do you mean by platform independence? What is an interface?

562


Why is java called the platform independent programming language?

568


How will you invoke any external process in java?

596


What happens if main method is not static?

489


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

550


Can a static class implement an interface?

543


What's the difference between an abstract class and interface in java?

550