What is race condition ?? (Threading concept) TCS 2 sept10

Answers were Sorted based on User's Feedback



What is race condition ?? (Threading concept) TCS 2 sept10..

Answer / 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

What is race condition ?? (Threading concept) TCS 2 sept10..

Answer / atasi

threads can try to update same data structure at same time,one thread can wrote one part,other tthread ca wrote another part,then all data struture garbles,when new thraed ca want to access it ,it will be crashed

Is This Answer Correct ?    0 Yes 0 No

What is race condition ?? (Threading concept) TCS 2 sept10..

Answer / suj

Race conditions
: Threads can try to update the same data structure at the same time.
The result can be partly what one thread wrote and partly what the other thread wrote.
This garbles the data structure, typically causing the next thread that tries to use it to
crash.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

write a program to create an vector with string(add,remove) operation.and value should be enter through keyboard.

0 Answers   Axcend,


What classes of exceptions, caught by a catch clause?

1 Answers  


Is string pool garbage collected?

0 Answers  


List the features of java programming language.

0 Answers  


What state does a thread enter when it terminates its processing in java programming?

0 Answers  






Which one will take more memory: an int or integer?

0 Answers  


what is check p object in java

1 Answers   TCS,


What is double word?

0 Answers  


what is actual real time using of oops concepts in projects(Interface,polymorphism.abstraction.........)

2 Answers  


How infinite loop is declared?

0 Answers  


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

0 Answers  


What is the difference between throw and throws in java?

0 Answers  


Categories